diff options
author | Dan Gudmundsson <[email protected]> | 2016-03-03 13:37:03 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2016-03-08 08:54:31 +0100 |
commit | 21f3a5c817d9a2a53670c8ac57c7ec5171bb25ed (patch) | |
tree | 81a4db68ca4ec77968ea909ec99f00fe29bccdc6 /erts/emulator/test/estone_SUITE.erl | |
parent | 184bc747089398d7fd74aef9bce48b42e8e71464 (diff) | |
download | otp-21f3a5c817d9a2a53670c8ac57c7ec5171bb25ed.tar.gz otp-21f3a5c817d9a2a53670c8ac57c7ec5171bb25ed.tar.bz2 otp-21f3a5c817d9a2a53670c8ac57c7ec5171bb25ed.zip |
test: do not divide by zero
Diffstat (limited to 'erts/emulator/test/estone_SUITE.erl')
-rw-r--r-- | erts/emulator/test/estone_SUITE.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/test/estone_SUITE.erl b/erts/emulator/test/estone_SUITE.erl index dc8f0aaee9..d49ab3de4d 100644 --- a/erts/emulator/test/estone_SUITE.erl +++ b/erts/emulator/test/estone_SUITE.erl @@ -382,11 +382,11 @@ apply_micro(M) -> {weight_percentage, M#micro.weight}, {loops, M#micro.loops}, {microsecs,MicroSecs}, - {estones, (M#micro.weight * M#micro.weight * ?STONEFACTOR) div MicroSecs}, + {estones, (M#micro.weight * M#micro.weight * ?STONEFACTOR) div max(1,MicroSecs)}, {gcs, GC1 - GC0}, {kilo_word_reclaimed, (Words1 - Words0) div 1000}, {kilo_reductions, Reds div 1000}, - {gc_intensity, gci(Elapsed, GC1 - GC0, Words1 - Words0)}]. + {gc_intensity, gci(max(1,Elapsed), GC1 - GC0, Words1 - Words0)}]. monotonic_time() -> try erlang:monotonic_time() catch error:undef -> erlang:now() end. |