Change implementation of misc:unique_timestamp()

This commit is contained in:
Paweł Chmielowski 2019-04-16 11:20:55 +02:00
parent 83653c0338
commit 4e2c95fe58
1 changed files with 2 additions and 3 deletions

View File

@ -483,6 +483,5 @@ get_dir(Type) ->
%% Generates erlang:timestamp() that is guaranteed to unique
-spec unique_timestamp() -> erlang:timestamp().
unique_timestamp() ->
Time = erlang:system_time(microsecond),
UI = erlang:unique_integer([positive, monotonic]),
usec_to_now(Time + UI).
{MS, S, _} = erlang:timestamp(),
{MS, S, erlang:unique_integer([positive, monotonic]) rem 1000000}.