mike-ward/VSColorOutput

VSColorOutput doesn't show timestamp for all lines

Closed this issue · 7 comments

Why? Would it be possible to show timestamps for each line? Thank you very much! Great extension!

The resolution of the timers is such that many statements have the same timestamp, which made it almost impossible to spot time changes. Thus the current implementation which eliminates the duplicates.

Thank you for the explanation. I looked into your code and I found you use DateTime.Now. Look at Stopwatch class which is mentioned at page: https://docs.microsoft.com/en-us/dotnet/api/system.datetime.now?view=net-5.0 in the Remarks section. It can be used for this high performance purposes.

What's the use case that requires more than 15 milliseconds of resolution? Seems like it would be the same problem. Lots of lines with almost identical timestamps.

The problem is that VSColorOutput has too big granularity. May be it is not the problem of DateTime then. See this printscreen:
image

What's the use case? If you're using it for some kind of benchmarking then you'll likely be disappointed. Logging is usually asynchronous and out of band. It's a bit like having an egg timer with nanosecond accuracy.

5 seconds is too long time. If I want to have info about duration of SQL select in the output, I need to use another tools. It would be nice to see it in output without 3rd party tools.

VSColorOutput does not echo duplicate timestamps. It does this for readability. The statement indicating 5 seconds literally occurred 5 seconds after the log statements above it.

You're also assuming VSColorOutput gets notified when your log event fires. It's likely Visual Studio puts those log events in a queue and processes them asynchronously. VSColorOutput likely received those log events within a single timer tick.

I can only report when I received the event. Not when the event occurred.