diff options
author | Rickard Green <[email protected]> | 2014-12-17 22:18:27 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2015-03-20 15:28:53 +0100 |
commit | fbaa0becc787e73fa539e0d497b0d74be27c9534 (patch) | |
tree | c89e004b5e33d51ca07635678415c8dc4e8f2f23 /lib/hipe/tools/hipe_timer.erl | |
parent | 1d9350693fe2c4d1d6b2baa504aacd070e023a1a (diff) | |
download | otp-fbaa0becc787e73fa539e0d497b0d74be27c9534.tar.gz otp-fbaa0becc787e73fa539e0d497b0d74be27c9534.tar.bz2 otp-fbaa0becc787e73fa539e0d497b0d74be27c9534.zip |
Replace usage of erlang:now() with usage of new API
Diffstat (limited to 'lib/hipe/tools/hipe_timer.erl')
-rw-r--r-- | lib/hipe/tools/hipe_timer.erl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/hipe/tools/hipe_timer.erl b/lib/hipe/tools/hipe_timer.erl index 03cc358f17..5f44bc066d 100644 --- a/lib/hipe/tools/hipe_timer.erl +++ b/lib/hipe/tools/hipe_timer.erl @@ -46,27 +46,27 @@ tr(F) -> {R,{WT-EWT,(RT-ERT)/1000}}. empty_time() -> - {WT1,WT2,WT3} = erlang:now(), + WTA = erlang:monotonic_time(), {A,_} = erlang:statistics(runtime), - {WT12,WT22,WT32} = erlang:now(), + WTB = erlang:monotonic_time(), {B,_} = erlang:statistics(runtime), - {(WT12-WT1)*1000000+(WT22-WT2)+(WT32-WT3)/1000000,B-A}. + {(WTB-WTA)/erlang:convert_time_unit(1, seconds, native),B-A}. time(F) -> - {WT1,WT2,WT3} = erlang:now(), + WTA = erlang:monotonic_time(), {A,_} = erlang:statistics(runtime), F(), - {WT12,WT22,WT32} = erlang:now(), + WTB = erlang:monotonic_time(), {B,_} = erlang:statistics(runtime), - {(WT12-WT1)*1000000+(WT22-WT2)+(WT32-WT3)/1000000,B-A}. + {(WTB-WTA)/erlang:convert_time_unit(1, seconds, native),B-A}. timer(F) -> - {WT1,WT2,WT3} = erlang:now(), + WTA = erlang:monotonic_time(), {A,_} = erlang:statistics(runtime), R = F(), - {WT12,WT22,WT32} = erlang:now(), + WTB = erlang:monotonic_time(), {B,_} = erlang:statistics(runtime), - {R,{(WT12-WT1)*1000000+(WT22-WT2)+(WT32-WT3)/1000000,B-A}}. + {R,{(WTB-WTA)/erlang:convert_time_unit(1, seconds, native),B-A}}. advanced(_Fun, I) when I < 2 -> false; advanced(Fun, Iterations) -> |