[erlang-questions] now() seems to produce inconsistent timestamps.

Nicholas Schultz-Møller <>
Fri Aug 1 01:40:33 CEST 2008


I don't agree.

As you said, now() is guaranteed to return a new value (which can be used as
a unique identifier) on consequtive calls to now() but that is within the
same Eshell. Furthermore one now() call occurs before the other and as both
Eshells read the same system clock they should also read timestamps with the
same ordering.

/Nicholas



2008/8/1 Dominic Williams <
>

> Hi Nicholas,
>
> Nicholas Schultz-Møller a écrit :
>
>  Is this a bug or a feature? Does two or more Eshells not
>> agree on the time when running on the same host???
>>
>
> It's a feature. now() is guaranteed never to return the same
> value twice, even if you call it from the same shell,
> process, or whatever, practically instantaneously.
>
> E.g.
>
> 1> {now(), now()}.
> {{1217,545379,571066},{1217,545379,571070}}
>
>
> Cheers,
>
> Dominic Williams
> http://dominicwilliams.net
>
> ----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080801/094f1d5a/attachment.html>


More information about the erlang-questions mailing list