diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2017-01-13 21:59:44 +0100 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2017-02-02 10:43:48 +0100 |
commit | db07f91899f2ed4dd52cafc5af103790c00f5462 (patch) | |
tree | 856d14c3583b381fdfc1e73b85bc9ea3973ae0c7 /src/bench | |
parent | 02e5308c1b9f3771bbe49bc5036215fa2bd66aa9 (diff) |
Assert that what might look like a possible division by zero is actually unreachable
Diffstat (limited to 'src/bench')
-rw-r--r-- | src/bench/bench.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp index 1bd9d06b80..24b2b56e9a 100644 --- a/src/bench/bench.cpp +++ b/src/bench/bench.cpp @@ -92,6 +92,8 @@ bool benchmark::State::KeepRunning() --count; + assert(count != 0 && "count == 0 => (now == 0 && beginTime == 0) => return above"); + // Output results double average = (now-beginTime)/count; int64_t averageCycles = (nowCycles-beginCycles)/count; |