Count up timer that stops when the user leaves the page

I'd like to add a timer to one page of my app that:

  • counts up whenever a user is on the page

  • pauses the user leaves the page

  • restarts where it left off when the user re-opens the page

Any ideas of an efficient way of implementing this? I've tried:

  • using the timer widget. This doesn't work as the timer restarts every time the user leaves the page

  • Using page parameters and a periodic action. This doesn't work as the periodic action continues even when a user leaves the page

Thanks in advance,
Dan

1
3 replies