[erlang-questions] System timers, now/0, and instrumentation

Magnus Henoch <>
Tue May 24 11:02:17 CEST 2011

----- "Amy Lear" <> wrote:

> The issue here as I understand it is that the system clock itself
> can't report things in the microsecond range (msdn states the
> granularity is between 10ms and 15ms:
> http://msdn.microsoft.com/en-us/library/system.datetimeoffset.utcnow.aspx
> ), but the real values are being mangled to provide those guaranteed
> unique values. Given that now/0 is the obvious means of doing
> measurement for an erlang user -- and in fact the instrumentation
> tools that ship with erlang also appear to rely on it -- this results
> in puzzling and undesired behavior.

Have you tried os:timestamp/0?  It's like now/0 but without the
uniqueness guarantee.  I'm not sure what granularity it has on
Windows, though.

Hope this helps,
Magnus Henoch
Erlang Solutions Ltd

More information about the erlang-questions mailing list