aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-04-27 10:09:33 +0200
committerBjörn Gustavsson <[email protected]>2015-04-27 10:09:33 +0200
commit6f0a08d85feac7103b573e20d6250ea880c6400f (patch)
tree4becfa81c3f29e0c885c9ea722be2b5e76abdd88 /lib/test_server
parent19c7d1f88c8d393ee6b9ba82b36389f01b5c0372 (diff)
parent47e7f00fe52ceb675c94a4800c297ce98d6bee30 (diff)
downloadotp-6f0a08d85feac7103b573e20d6250ea880c6400f.tar.gz
otp-6f0a08d85feac7103b573e20d6250ea880c6400f.tar.bz2
otp-6f0a08d85feac7103b573e20d6250ea880c6400f.zip
Merge branch 'bjorn/use-monotonic-time'
* bjorn/use-monotonic-time: supervisor: Correct restart handling test_server: Use erlang:monotonic_time/0 compile: Teach 'time' option to show three significant decimals timer: Use monotonic_time/0 in tc/1,2,3
Diffstat (limited to 'lib/test_server')
-rw-r--r--lib/test_server/src/test_server.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl
index acd2e0bff2..7f2da7755a 100644
--- a/lib/test_server/src/test_server.erl
+++ b/lib/test_server/src/test_server.erl
@@ -1822,7 +1822,7 @@ time_ms_check(Other) ->
time_ms_apply(Func, TCPid, MultAndScale) ->
{_,GL} = process_info(TCPid, group_leader),
WhoAmI = self(), % either TC or IO server
- T0 = os:timestamp(),
+ T0 = erlang:monotonic_time(),
UserTTSup =
spawn(fun() ->
user_timetrap_supervisor(Func, WhoAmI, TCPid,
@@ -1855,7 +1855,8 @@ user_timetrap_supervisor(Func, Spawner, TCPid, GL, T0, MultAndScale) ->
receive
{UserTT,Result} ->
demonitor(MonRef, [flush]),
- Elapsed = trunc(timer:now_diff(os:timestamp(), T0) / 1000),
+ T1 = erlang:monotonic_time(),
+ Elapsed = erlang:convert_time_unit(T1-T0, native, milli_seconds),
try time_ms_check(Result) of
TimeVal ->
%% this is the new timetrap value to set (return value
@@ -1923,7 +1924,7 @@ update_user_timetraps(TCPid, StartTime) ->
proplists:delete(TCPid, UserTTs)),
proceed;
{OtherUserTTSup,OtherStartTime} ->
- case timer:now_diff(OtherStartTime, StartTime) of
+ case OtherStartTime - StartTime of
Diff when Diff >= 0 ->
ignore;
_ ->