diff --git a/tests/benchmarks/core/bench_scheduler.cpp b/tests/benchmarks/core/bench_scheduler.cpp index 897e3adc98..40bed05327 100644 --- a/tests/benchmarks/core/bench_scheduler.cpp +++ b/tests/benchmarks/core/bench_scheduler.cpp @@ -72,13 +72,13 @@ static void Scheduler_Call_5IntervalsFiring(benchmark::State &state) { } scheduler.process_to_add(); - // Must be monotonic — millis_64_from_() tracks rollovers. - uint32_t now = millis() + 100; - for (auto _ : state) { + // Use real millis() each outer iteration so our fake time stays close + // to wall clock — WarnIfComponentBlockingGuard compares the `now` we + // pass to scheduler.call() against real millis() in finish(). + uint32_t now = millis(); for (int i = 0; i < kInnerIterations; i++) { scheduler.call(now); - // Advance time by 1ms so intervals are due again next call now++; } benchmark::DoNotOptimize(fire_count);