Using millis() for timing
Arduino UNO (Kuman UNO)
Électronique / Electronic
It is not usually long before new Arduino users discover that although the delay() function is easy to use it has side effects, the main one of which is that its stops all activity on the Arduino until the delay is finished.
To use millis() for timing you need to record the time at which an action took place to start the timing period and then to check at frequent intervals whether the required period has elapsed.
Using millis() for timing Code