Skip to content

Commit 2576790

Browse files
committed
Fix minimum benchmark time with multiple threads
Closes #2117
1 parent 4ed29ae commit 2576790

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/benchmark_runner.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ BenchmarkRunner::IterationResults BenchmarkRunner::DoNIterations() {
361361
} else if (b.use_real_time()) {
362362
i.seconds = i.results.real_time_used;
363363
}
364+
// The time is the sum over all threads, we want each of them to run the
365+
// specificed minimum time.
366+
i.seconds /= b.threads();
364367

365368
return i;
366369
}

0 commit comments

Comments
 (0)