summaryrefslogtreecommitdiff
path: root/lib/test_server
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2015-04-20 15:42:39 +0200
committerBjörn Gustavsson <bjorn@erlang.org>2015-04-20 15:46:13 +0200
commit5201e1852b034a6566828e1ba267c2afaa017933 (patch)
tree7e9b0c5736741d9a5bfa07ac6c33ad7098b06780 /lib/test_server
parent740ecf83a6cec93fc40a3ced1f7d8825a39516e4 (diff)
downloaderlang-5201e1852b034a6566828e1ba267c2afaa017933.tar.gz
test_server: Use erlang:monotonic_time/0
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;
_ ->