[erlang-questions] os:timestamp/0 and erlang:now/0

Karolis Petrauskas <>
Fri Mar 13 19:53:34 CET 2015


Hello,

I have noticed strange behaviour on one of our erlang nodes.
erlang:now() returns smaller values, than os:timestamp(). I thought,
it could be opposite in some hi-load situations, but this surprised
me. The following test reproduces the situation on that particular
node (N >= T is false), while it returns true on newly created VMs.

    f(T), f(N), T = os:timestamp(), N = erlang:now(), {N >= T, T, N}.
    {false,{1426,271957,819043},{1426,271957,809685}}

The node runs `Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:2:2]
[async-threads:10] [hipe] [kernel-poll:false]` on Linux running on a
virtual machine. The node has no noticeable load, not more than
several transactions per minute.

Is this normal behaviour, or I found a bug?

Karolis


More information about the erlang-questions mailing list