[erlang-questions] Time Granularity on Windows

Rob A'Court rob@REDACTED
Fri Jan 29 16:32:52 CET 2016


I can appreciate it wouldn’t be suitable in the general case for time, but for our use case of timing intervals for performance analysis the monotonic nature is less important.

From: Lukas Larsson [mailto:lukas.larsson@REDACTED]
Sent: 29 January 2016 14:38
To: Rob A'Court <rob@REDACTED>
Cc: erlang-questions@REDACTED
Subject: Re: [erlang-questions] Time Granularity on Windows

The problem with QPC is that it is not monotonic. From https://msdn.microsoft.com/en-us/library/dn553408.aspx.

"Can the performance counter be used to order events in time?
Yes. However, when comparing performance counter results that are acquired from different threads, values that differ by ± 1 tick have an ambiguous ordering as if they had an identical time stamp."

If it wasn't for that small caveat we would have used it.

Lukas

On Fri, Jan 29, 2016 at 2:32 PM, Rob A'Court <rob@REDACTED<mailto:rob@REDACTED>> wrote:
Ok, fine. Thank you!


We’ve done a bit more research and it looks like it is possible to get better granularity on Windows, but only by making a windows kernel call:
http://erlang.org/pipermail/erlang-questions/2011-May/058940.html


From: Lukas Larsson [mailto:lukas@REDACTED<mailto:lukas@REDACTED>]
Sent: 29 January 2016 10:33
To: Rob A'Court <rob@REDACTED<mailto:rob@REDACTED>>
Cc: erlang-questions@REDACTED<mailto:erlang-questions@REDACTED>
Subject: Re: [erlang-questions] Time Granularity on Windows

Hello,

On Fri, Jan 29, 2016 at 11:17 AM, Rob A'Court <rob@REDACTED<mailto:rob@REDACTED>> wrote:

Is this a problem with something I am doing or with the granularity of the windows system clock?

It is a problem with the granularity of the monotonic time source on Windows.


Is there another approach I could take to get accurate (~microsecond granularity) timestamps on windows and linux?


Maybe try os:timestamp on windows? I can't remember what it falls back onto, but as it does not have any monoticity guarantees it may give better values.

Lukas

_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED<mailto:erlang-questions@REDACTED>
http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160129/0f837736/attachment.htm>


More information about the erlang-questions mailing list