Helper: Run scheduler for specified duration
| 82 | |
| 83 | // Helper: Run scheduler for specified duration |
| 84 | void runScheduler(Scheduler& ts, unsigned long duration_ms) { |
| 85 | unsigned long start = millis(); |
| 86 | while (millis() - start < duration_ms) { |
| 87 | ts.execute(); |
| 88 | delay(1); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | // Helper: Wait for condition with timeout |
| 93 | template<typename Condition> |