aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/gen_tcp_misc_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-05-26 14:08:39 +0200
committerBjörn Gustavsson <[email protected]>2015-05-27 04:51:11 +0200
commit5ab52ccbdd90ec7ab2a35294ca362f53e52fdf3d (patch)
tree1e1f81ee2a4e7b7d72a7cbc0ff0595826b4ce859 /lib/kernel/test/gen_tcp_misc_SUITE.erl
parent2065d20e00a5e5d1e526768c3be33d5ff86d2b53 (diff)
downloadotp-5ab52ccbdd90ec7ab2a35294ca362f53e52fdf3d.tar.gz
otp-5ab52ccbdd90ec7ab2a35294ca362f53e52fdf3d.tar.bz2
otp-5ab52ccbdd90ec7ab2a35294ca362f53e52fdf3d.zip
Eliminate use of erlang:now/0 for measuring time
Diffstat (limited to 'lib/kernel/test/gen_tcp_misc_SUITE.erl')
-rw-r--r--lib/kernel/test/gen_tcp_misc_SUITE.erl13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl
index 4e4aeb67e2..0a1d7900c6 100644
--- a/lib/kernel/test/gen_tcp_misc_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl
@@ -1655,8 +1655,7 @@ so_priority(Config) when is_list(Config) ->
%% Accept test utilities (suites are below)
millis() ->
- {A,B,C}=erlang:now(),
- (A*1000000*1000)+(B*1000)+(C div 1000).
+ erlang:monotonic_time(milli_seconds).
collect_accepts(Tmo) ->
A = millis(),
@@ -2208,10 +2207,10 @@ get_max_diff() ->
end.
get_max_diff(Max) ->
- T1 = millistamp(),
+ T1 = millis(),
receive
ok ->
- Diff = millistamp() - T1,
+ Diff = millis() - T1,
if
Diff > Max ->
get_max_diff(Diff);
@@ -2219,7 +2218,7 @@ get_max_diff(Max) ->
get_max_diff(Max)
end;
{error,timeout} ->
- Diff = millistamp() - T1,
+ Diff = millis() - T1,
if
Diff > Max ->
Diff;
@@ -2360,10 +2359,6 @@ setup_active_timeout_sink(Timeout, AutoClose) ->
{Loop,A,R,C}.
-millistamp() ->
- {Mega, Secs, Micros} = erlang:now(),
- (Micros div 1000) + Secs * 1000 + Mega * 1000000000.
-
has_superfluous_schedulers() ->
case {erlang:system_info(schedulers),
erlang:system_info(logical_processors)} of