Need a high-precision timestamp .NET function
I have used winapi TimeGetTime
. But it uses Int32
, cycles every 49.8 days and return can be signed
.
What is a native .NET high-precision function which return type is Int64
or UInt64
, returns milliseconds?
It is not important whether it returns milliseconds from system start or any other time in the past.
Actually I don't need StopWatch
EDIT:
My application is multithreaded. StopWatch
instance should be created for every thread. StopWatch
has a very high-precision timer. I need only 1-5ms.
What I need is something like timeGetTime / Environment.TickCount as Int64 or DateTime.Ticks with update resolution of 1-5ms