Understanding time

Ulf Wiger ulf@REDACTED
Tue Sep 7 09:29:13 CEST 2021


I noted afterwards that I hadn't cc:ed the list in my reply:

On Tue, Sep 7, 2021 at 8:50 AM Ulf Wiger <ulf@REDACTED> wrote:

> Yes, operations documented as monotonic are performed atomically by the VM
> to ensure the property, allowing the monotonic clock to drift up to 1 ms
> relative to 'actual' time See erts/emulator/erl_time_sup.c.
>
> If not documented as monotonic, you should not assume that it is.
>
> BR,
> Ulf W
>

On Tue, Sep 7, 2021 at 9:20 AM Frank Muller <frank.muller.erl@REDACTED>
wrote:

> Crystal clear guys. Thank you so much
>
>
>
>> It is not strictly monotonic, see the note:
>> https://erlang.org/doc/man/erlang.html#monotonic_time-0
>>
>> Also see this if you need ordered events:
>>
>> https://erlang.org/doc/apps/erts/time_correction.html#Dos_and_Donts_Determine_Order_of_Events_With_Time_of_the_Event
>>
>> Cheers,
>>
>> On 07/09/2021 08:27, Frank Muller wrote:
>> > Hi Everyone
>> >
>> > Yesterday, a Java developer told me that getting unique timestamps is
>> > only guaranteed to be possible between COREs on the same CPU. Stated
>> > otherwise, two processes on two different CPUs could get the same
>> timestamp.
>> >
>> > I’m now wondering if calls to “erlang:system_time/1” are strictly
>> > monotonic
>> > (
>> https://erlang.org/doc/apps/erts/time_correction.html#strictly-monotonically-increasing)
>>
>> > between Erlang processes on the same scheduler, and even between Erlang
>> > processes on different schedulers.
>> >
>> > Can anyone clarify please?
>> >
>> > /Frank
>>
>> --
>> Loïc Hoguin
>> https://ninenines.eu
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20210907/1978d7df/attachment.htm>


More information about the erlang-questions mailing list