[erlang-questions] Time Granularity on Windows
Fri Jan 29 11:17:17 CET 2016
I'm trying to take some timings in our app.
I'm taking timestamps using erlang:monotonic_time when certain events happen but noticed that on windows these aren't what I’m expecting
The test below on linux logs the difference as being about 1ms. without the sleep its about 0.001ms which is what I would expect.
On windows, the diff is 16ms, even if i change the timer to 10ms sleep. without the timer the difference is always 0ms.
First = erlang:monotonic_time(),
Second = erlang:monotonic_time(),
TimeDiff = erlang:convert_time_unit((Second - First), native, nano_seconds)/1000000,
Is this a problem with something I am doing or with the granularity of the windows system clock?
Is there another approach I could take to get accurate (~microsecond granularity) timestamps on windows and linux?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions