Skip to content

Commit fae028f

Browse files
committed
Use manual time instead of real time for better repeatability
1 parent 0a27b8d commit fae028f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/scoped_pause_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ void BM_ScopedPause(benchmark::State& state) {
1111
for (auto _ : state) {
1212
benchmark::ScopedPauseTiming pause(state);
1313
std::this_thread::sleep_for(std::chrono::milliseconds(10));
14+
state.SetIterationTime(0.0);
1415
}
1516
}
16-
BENCHMARK(BM_ScopedPause)->UseRealTime()->Iterations(1);
17+
BENCHMARK(BM_ScopedPause)->UseManualTime()->Iterations(1);
1718

1819
void CheckResults(Results const& results) {
1920
// Check that the real time is much less than the 10ms sleep time.

0 commit comments

Comments
 (0)