Fix scheduler benchmark: use fake time with guard disabled at compile time

interval=0 causes infinite loop (reschedules at same time, never breaks).
interval=1 with millis() doesn't work (real time doesn't advance fast
enough between inner iterations for intervals to re-fire).

Solution: use interval=1 with monotonically increasing fake time (now++)
and disable WarnIfComponentBlockingGuard at compile time via
-DWARN_IF_BLOCKING_OVER_MS=UINT32_MAX in benchmark build flags. This
prevents the guard's (millis() - started_) underflow when fake time
exceeds real millis().
This commit is contained in:
J. Nick Koston
2026-03-17 01:00:06 -10:00
parent d7be19703b
commit ec60e2c228
2 changed files with 14 additions and 6 deletions
+4
View File
@@ -34,6 +34,10 @@ PLATFORMIO_OPTIONS = {
"-O2", # optimize for speed (CodSpeed recommends RelWithDebInfo)
"-g", # debug symbols for profiling
USE_TIME_TIMEZONE_FLAG,
# Disable WarnIfComponentBlockingGuard check — scheduler benchmarks
# use fake monotonic time ahead of real millis(), causing uint32_t
# underflow in the guard's (millis() - started_) calculation.
"-DWARN_IF_BLOCKING_OVER_MS=UINT32_MAX",
],
# Use deep+ LDF mode to ensure PlatformIO detects the benchmark
# library dependency from nested includes.