[erlang-questions] Unixtime in Erlang

Scott Lystig Fritchie fritchie@REDACTED
Thu Jan 24 22:26:09 CET 2013


Motiejus Jakštys <desired.mta@REDACTED> 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