From 9492e5f9730de2083044625552eee3c804be4fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 30 Nov 2011 16:58:58 +0100 Subject: eprof_SUITE: Cope with fast computers and bad time measurements --- lib/tools/test/eprof_SUITE.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/tools') 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), -- cgit v1.2.3