[erlang-bugs] erlang:monotonic_time() is negative
Loïc Hoguin
essen@REDACTED
Tue Sep 1 15:42:02 CEST 2015
On 09/01/2015 02:20 PM, Sergej Jurečko wrote:
> hello,
>
> Using 18.0.3 on OS X 10.10.5. I even tried rebooting the machine to
> check if the time turns negative after a while, but it seems it is
> always negative.
>
> erlang:monotonic_time().
> -576460736152226213
From the docs, emphasis added:
Different runtime system instances will use different unspecified points
in time as base for their Erlang monotonic clocks. That is, it is
pointless comparing monotonic times from different runtime system
instances. Different runtime system instances may also place this
unspecified point in time different relative runtime system start. It
may be placed in the future (time at start will be a *negative value*),
the past (time at start will be a positive value), or the runtime system
start (time at start will be zero).
It's surprising the first time I admit.
--
Loïc Hoguin
http://ninenines.eu
Author of The Erlanger Playbook,
A book about software development using Erlang
More information about the erlang-bugs
mailing list