0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Use the new unique_integer function to generate IDs

In the eventsource example.
This commit is contained in:
Loïc Hoguin 2015-07-27 17:30:17 +02:00
parent a38735c18e
commit e923850389

View file

@ -18,6 +18,4 @@ info({message, Msg}, Req, State) ->
{ok, Req, State}.
id() ->
{Mega, Sec, Micro} = erlang:now(),
Id = (Mega * 1000000 + Sec) * 1000000 + Micro,
integer_to_list(Id, 16).
integer_to_list(erlang:unique_integer([positive, monotonic]), 16).