aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-11-30 16:58:58 +0100
committerBjörn Gustavsson <[email protected]>2011-12-02 16:59:34 +0100
commit9492e5f9730de2083044625552eee3c804be4fb6 (patch)
treebae0aa6ea394368e1a23c1a4ab292325642d19f7 /lib/tools
parent8e08eb43c74de37075bdf2bd60582a4c96114dc5 (diff)
downloadotp-9492e5f9730de2083044625552eee3c804be4fb6.tar.gz
otp-9492e5f9730de2083044625552eee3c804be4fb6.tar.bz2
otp-9492e5f9730de2083044625552eee3c804be4fb6.zip
eprof_SUITE: Cope with fast computers and bad time measurements
Diffstat (limited to 'lib/tools')
-rw-r--r--lib/tools/test/eprof_SUITE.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/tools/test/eprof_SUITE.erl b/lib/tools/test/eprof_SUITE.erl
index ecdbc5ce57..3283fa571f 100644
--- a/lib/tools/test/eprof_SUITE.erl
+++ b/lib/tools/test/eprof_SUITE.erl
@@ -183,8 +183,14 @@ eed(Config) when is_list(Config) ->
?line ok = eprof:log("eprof_SUITE_logfile"),
?line stopped = eprof:stop(),
?line ?t:timetrap_cancel(TTrap),
- S = lists:flatten(io_lib:format("~p times slower", [10*(T3-T2)/(T2-T1)])),
- {comment,S}.
+ try
+ S = lists:flatten(io_lib:format("~p times slower",
+ [10*(T3-T2)/(T2-T1)])),
+ {comment,S}
+ catch
+ error:badarith ->
+ {comment,"No time elapsed. Bad clock? Fast computer?"}
+ end.
ensure_eprof_stopped() ->
Pid = whereis(eprof),