[erlang-questions] Replacing erlang:now/0 for getting a unique number

Theepan <>
Fri Sep 18 09:30:13 CEST 2015


It depends on where you want the number to be unique (intra node/inter
node), and the frequency of unique number generation (system calls are
heavy), you can look at how you are generating the unique number. You can
look at just having a counter too.

Theepan

On Fri, Sep 18, 2015 at 12:34 PM, Martin Koroudjiev <>
wrote:

> Hello,
>
> I have code that users erlang:now/0 to get a unique number. What is the
> alternative in OTP 18? In the documentation for erlang:monotonic_time/0
> says that consecutive calls might produce same results.
>
> Thanks,
> Martin
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150918/51e05a36/attachment.html>


More information about the erlang-questions mailing list