millis() software timeout vs Watchdog Timer for graceful cancellation on AVR Arduino
A design needs a timeout and cancellation path for operations that may block, while keeping the sketch responsive and preserving RAM state across the timeout. Arduino core offers two documented mechanisms. A non-blocking millis() timer keeps the loop running and allows manual elapsed-time checks with rollover-safe unsigned arithmetic. The hardware Watchdog T