aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/file_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-06-05 10:19:23 +0200
committerBjörn Gustavsson <[email protected]>2015-06-05 10:19:23 +0200
commit24a161d8c479e70ad55ebac18cd92ecc41dd607c (patch)
treea8a820696df69100100d11e282cdde291303bc9a /lib/kernel/test/file_SUITE.erl
parentccb7207b8ee271048905ef9b11448f98c645d533 (diff)
parent34e019dc29044e6f3b8d256a20f4ca83a3ac24a7 (diff)
downloadotp-24a161d8c479e70ad55ebac18cd92ecc41dd607c.tar.gz
otp-24a161d8c479e70ad55ebac18cd92ecc41dd607c.tar.bz2
otp-24a161d8c479e70ad55ebac18cd92ecc41dd607c.zip
Merge branch 'bjorn/kernel/cuddle-with-tests'
* bjorn/kernel/cuddle-with-tests: Clean up rpc_SUITE:call_benchmark/1 Eliminate use of erlang:now/0 for generating random numbers Eliminate use of erlang:now/0 for measuring time Eliminate use of erlang:now/0 for generating unique node names
Diffstat (limited to 'lib/kernel/test/file_SUITE.erl')
-rw-r--r--lib/kernel/test/file_SUITE.erl15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl
index 1213d8e37e..48abc92e4c 100644
--- a/lib/kernel/test/file_SUITE.erl
+++ b/lib/kernel/test/file_SUITE.erl
@@ -3914,7 +3914,7 @@ response_analysis(Module, Function, Arguments) ->
receive {Parent, start, Ts} -> ok end,
Stat =
iterate(response_stat(response_stat(init, Ts),
- erlang:now()),
+ micro_ts()),
done,
fun (S) ->
erlang:yield(),
@@ -3922,12 +3922,12 @@ response_analysis(Module, Function, Arguments) ->
{Parent, stop} ->
done
after 0 ->
- response_stat(S, erlang:now())
+ response_stat(S, micro_ts())
end
end),
- Parent ! {self(), stopped, response_stat(Stat, erlang:now())}
+ Parent ! {self(), stopped, response_stat(Stat, micro_ts())}
end),
- ?line Child ! {Parent, start, erlang:now()},
+ Child ! {Parent, start, micro_ts()},
?line Result = apply(Module, Function, Arguments),
?line Child ! {Parent, stop},
?line {N, Sum, _, M, Max} = receive {Child, stopped, X} -> X end,
@@ -3941,12 +3941,13 @@ response_analysis(Module, Function, Arguments) ->
[Mean_ms, Max_ms, M, (N-1)])),
?line {Result, Comment}.
-
+micro_ts() ->
+ erlang:monotonic_time(micro_seconds).
response_stat(init, Ts) ->
{0, 0, Ts, 0, 0};
-response_stat({N, Sum, {A1, B1, C1}, M, Max}, {A2, B2, C2} = Ts) ->
- D = C2-C1 + 1000000*((B2-B1) + 1000000*(A2-A1)),
+response_stat({N, Sum, Ts0, M, Max}, Ts) ->
+ D = Ts - Ts0,
if D > Max ->
{N+1, Sum+D, Ts, N, D};
true ->