C # works just like Java System.currentTimeMillis ()

I am looking for a way to get temporary functionality that uses only primitives and does not generate objects. This feature will potentially be used hundreds of times per second, so I'm looking for maximum performance. I would like to get millisecond detail.

+4
source share
2 answers

System.Diagnostics.Stopwatch is the most commonly used synchronization mechanism. It has fairly low overhead and can be a problem with millisecond granularity. If you need higher accuracy, I would recommend an external profiler.

+3
source

Source: https://habr.com/ru/post/1300269/


All Articles