mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Change implementation of misc:unique_timestamp()
This commit is contained in:
parent
83653c0338
commit
4e2c95fe58
@ -483,6 +483,5 @@ get_dir(Type) ->
|
|||||||
%% Generates erlang:timestamp() that is guaranteed to unique
|
%% Generates erlang:timestamp() that is guaranteed to unique
|
||||||
-spec unique_timestamp() -> erlang:timestamp().
|
-spec unique_timestamp() -> erlang:timestamp().
|
||||||
unique_timestamp() ->
|
unique_timestamp() ->
|
||||||
Time = erlang:system_time(microsecond),
|
{MS, S, _} = erlang:timestamp(),
|
||||||
UI = erlang:unique_integer([positive, monotonic]),
|
{MS, S, erlang:unique_integer([positive, monotonic]) rem 1000000}.
|
||||||
usec_to_now(Time + UI).
|
|
||||||
|
Loading…
Reference in New Issue
Block a user