[erlang-questions] Unixtime in Erlang

Schneider <>
Fri Jan 25 13:33:28 CET 2013


thnx.

On Thu 24 Jan 2013 10:26:09 PM CET, Scott Lystig Fritchie wrote:
> Motiejus Jakštys <> wrote:
>
> mj> os:timestamp() is a slightly faster version of erlang:now().
>
> Slight correction: it's quite a bit faster than erlang:now(), if you're
> executing in a heavily loaded VM on an multi-core machine.
>
> IIRC (untested code):
>
>      now_as_time_t() ->
>          {A, B, _} = os:timestamp(),
>          (A * 1000000) + B.
>
> -Scott





More information about the erlang-questions mailing list