millis()
Returns the number of milliseconds since the program start running. This number will overflow (go back to zero), after approximately 50 days.
Parameters
None
Returns
Number of milliseconds since the program started (unsigned long)
Example
#include "Arduino.h"
void setup() {
}
void loop() {
printf("Delay since start in millis %lu \n", millis());
printf("Delay since start in micros %lu \n", micros());
delayMicroseconds(1000000); // Delay 1 second
delay(1000); // Delay 1 second
}