Need help on how to time a system using arduino board

Hello everyone

I need help, currently trying to design a system where I can get the duration between the time my system starts working and the time at which it finishes. But sincerely don't really know what to use as components or library to enable the timing .

An example of the system : Assuming my LED was off when I power my system and then some minutes later starts working and stop after a while.

Now my question is how will I get the duration between the time it has started working and the time it ended.

Is there any library that can help me to find the time ? Or it's rather a component ?
please help . thank you so much.

Do you need to record the time as in wall clock time (started at 04:32, ended 04:46, duration 14m) or is it just enough to know the 14m?

If the former you will need a Real Time Clock chip or connection to internet time.

If the latter, use millis() which starts from 0 at power up and counts milliseconds. So capture the time the led goes on (your "some minutes", ms), and capture the time it goes off, subtract.

What is it that causes the led to go off and on?- some kind of external stimulus?

In fact, just remembered my code in #4 here times the interval bewteen 2x button presses. It might be worth a look?