I am going to make use of same function I created in this post:
Let’s modify the code in the post above slightly to get what we want.
We’re going to show hours, minutes and seconds elapsed. You can add microseconds as well, just like the stopwatch example or just keep minutes and seconds.
Let’s give it a nice look using CSS. It’s not required for background processing for e.g. if you want to keep track of user’s timing activities.
elapsed time setTimeout stopwatch