I need to find a way so that whenever I turn a LED on, I record the duration of that LED without stopping the program (no delay()). The LED will last a few seconds until it turns off automatically but the program still runs infinitely long (until shut off). So that I can turn on the LED again, record that time, and shut off after a few seconds. Repeat.
The problem I had with using millis() is that it records the program time when the hardware is first turned on.
Are there any libraries that can assist me with this?