Revert scheduler now reset — must be monotonic for millis_64_from_

millis_64_from_() tracks 32-bit rollovers, so going backwards in time
would appear as a ~49 day forward jump. Keep now monotonically
increasing across all iterations. With 2000 inner iterations per outer
iteration, overflow is not a practical concern.
This commit is contained in:
J. Nick Koston
2026-03-17 00:37:58 -10:00
parent ca2cf4044c
commit e45cfc5451
+6 -2
View File
@@ -72,9 +72,13 @@ static void Scheduler_Call_5IntervalsFiring(benchmark::State &state) {
}
scheduler.process_to_add();
// Start at a known time so intervals are immediately due.
// now increases monotonically across all iterations — this is required
// because millis_64_from_() tracks rollovers and going backwards would
// appear as a 32-bit wrap (~49 day jump forward).
uint32_t now = millis() + 100;
for (auto _ : state) {
// Reset each outer iteration to avoid unbounded growth toward UINT32_MAX
uint32_t now = 100;
for (int i = 0; i < kInnerIterations; i++) {
scheduler.call(now);
// Advance time by 1ms so intervals are due again next call