diff options
| author | practicalswift <[email protected]> | 2017-01-13 21:59:44 +0100 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2017-02-02 10:43:48 +0100 |
| commit | db07f91899f2ed4dd52cafc5af103790c00f5462 (patch) | |
| tree | 856d14c3583b381fdfc1e73b85bc9ea3973ae0c7 | |
| parent | Merge #9525: test: Include tx data in EXTRA_DIST (diff) | |
| download | discoin-db07f91899f2ed4dd52cafc5af103790c00f5462.tar.xz discoin-db07f91899f2ed4dd52cafc5af103790c00f5462.zip | |
Assert that what might look like a possible division by zero is actually unreachable
| -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 1bd9d06b8..24b2b56e9 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; |