Skip to content

Commit

Permalink
Replace os:timestamp/0 with erlang:monotonic_time/0
Browse files Browse the repository at this point in the history
  • Loading branch information
lpgauth committed Apr 30, 2018
1 parent 68d6e47 commit da494e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/timing_hdr.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ run(TimingFun, Opts) ->
N = trunc(Iterations / Concurrency),
Iterations2 = N * Concurrency,
{ok, Hdr} = hdr_histogram:open(Iterations2, 3),
Timestamp = os:timestamp(),
T1 = erlang:monotonic_time(),
spawn_loop(Concurrency, TimingFun, N, self(), SpawnOpts),
{ok, Timings} = receive_timings(Concurrency, []),
TotalTime = timer:now_diff(os:timestamp(), Timestamp),
T2 = erlang:monotonic_time(),
TotalTime = erlang:convert_time_unit(T2 - T1, native, microsecond),
{ok, Errors} = timings_loop(lists:flatten(Timings), Hdr, 0),
hdr_histogram:log(Hdr, classic, Output),

Expand Down

0 comments on commit da494e7

Please sign in to comment.