aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/stdlib_bench_SUITE.erl
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2018-01-19 10:51:12 +0100
committerRaimo Niskanen <[email protected]>2018-01-19 10:51:12 +0100
commit5a2f606671664a0bfa2aea810e49e0c3396e9b3d (patch)
tree351a2b4013cdfbca26f5b4ddf87987ff3e719505 /lib/stdlib/test/stdlib_bench_SUITE.erl
parent0f051cfe47532e8a008fec47e25715eeb8479a0c (diff)
downloadotp-5a2f606671664a0bfa2aea810e49e0c3396e9b3d.tar.gz
otp-5a2f606671664a0bfa2aea810e49e0c3396e9b3d.tar.bz2
otp-5a2f606671664a0bfa2aea810e49e0c3396e9b3d.zip
Dodge divide by zero
Diffstat (limited to 'lib/stdlib/test/stdlib_bench_SUITE.erl')
-rw-r--r--lib/stdlib/test/stdlib_bench_SUITE.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/stdlib/test/stdlib_bench_SUITE.erl b/lib/stdlib/test/stdlib_bench_SUITE.erl
index 2ce089dbb7..294898a932 100644
--- a/lib/stdlib/test/stdlib_bench_SUITE.erl
+++ b/lib/stdlib/test/stdlib_bench_SUITE.erl
@@ -331,7 +331,12 @@ comparison(Cases, Kind, Config) ->
{comment, C}.
norm(T, Ref) ->
- io_lib:format("~.2f", [Ref/T]).
+ try Ref / T of
+ Norm ->
+ io_lib:format("~.2f", [Norm])
+ catch error:badarith ->
+ "---"
+ end.
-define(MAX_TIME_SECS, 3). % s
-define(MAX_TIME, 1000 * ?MAX_TIME_SECS). % ms