But you need to know the time since the program started or only the intervals.
unsigned long start = millis();
...
...
unsigned long stop = millis();
unsigned long interval = stop-start;
This will still work until the beginning and end are separated by 49 days. I doubt that you need to count the interval from the beginning of the program until the counter overflows.
See also here: http://forum.arduino.cc/index.php?topic=122413.0
source
share