diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/percept/src/percept.erl | 6 | ||||
-rw-r--r-- | lib/percept/test/percept_SUITE.erl | 14 |
2 files changed, 9 insertions, 11 deletions
diff --git a/lib/percept/src/percept.erl b/lib/percept/src/percept.erl index badb3f3d66..f1a2002c9d 100644 --- a/lib/percept/src/percept.erl +++ b/lib/percept/src/percept.erl @@ -226,7 +226,7 @@ stop_webserver(Port) -> parse_and_insert(Filename, DB) -> io:format("Parsing: ~p ~n", [Filename]), - T0 = erlang:now(), + T0 = erlang:monotonic_time(milli_seconds), Pid = dbg:trace_client(file, Filename, mk_trace_parser(self())), Ref = erlang:monitor(process, Pid), parse_and_insert_loop(Filename, Pid, Ref, DB, T0). @@ -239,8 +239,8 @@ parse_and_insert_loop(Filename, Pid, Ref, DB, T0) -> {parse_complete, {Pid, Count}} -> receive {'DOWN', Ref, process, Pid, normal} -> ok after 0 -> ok end, DB ! {action, consolidate}, - T1 = erlang:now(), - io:format("Parsed ~p entries in ~p s.~n", [Count, ?seconds(T1, T0)]), + T1 = erlang:monotonic_time(milli_seconds), + io:format("Parsed ~w entries in ~w ms.~n", [Count, T1 - T0]), io:format(" ~p created processes.~n", [length(percept_db:select({information, procs}))]), io:format(" ~p opened ports.~n", [length(percept_db:select({information, ports}))]), ok; diff --git a/lib/percept/test/percept_SUITE.erl b/lib/percept/test/percept_SUITE.erl index 06d62630ba..afb8bbdd5b 100644 --- a/lib/percept/test/percept_SUITE.erl +++ b/lib/percept/test/percept_SUITE.erl @@ -116,11 +116,10 @@ analyze(Config) when is_list(Config) -> Begin = processes(), Path = ?config(data_dir, Config), File = filename:join([Path,"profile_test.dat"]), - T0 = erlang:now(), + T0 = erlang:monotonic_time(milli_seconds), ?line ok = percept:analyze(File), - T1 = erlang:now(), - Secs = timer:now_diff(T1,T0)/1000000, - io:format("percept:analyze/1 took ~.2f s.~n", [Secs]), + T1 = erlang:monotonic_time(milli_seconds), + io:format("percept:analyze/1 took ~w ms.~n", [T1 - T0]), ?line {stopped, _} = percept_db:stop(), print_remainers(remainers(Begin, processes())), ok. @@ -133,11 +132,10 @@ analyze_dist(Config) when is_list(Config) -> Begin = processes(), Path = ?config(data_dir, Config), File = filename:join([Path,"ipc-dist.dat"]), - T0 = erlang:now(), + T0 = erlang:monotonic_time(milli_seconds), ?line ok = percept:analyze(File), - T1 = erlang:now(), - Secs = timer:now_diff(T1,T0)/1000000, - io:format("percept:analyze/1 took ~.2f s.~n", [Secs]), + T1 = erlang:monotonic_time(milli_seconds), + io:format("percept:analyze/1 took ~w ms.~n", [T1 - T0]), ?line {stopped, _} = percept_db:stop(), print_remainers(remainers(Begin, processes())), ok. |