Timer that repeats on different screens

Hello everyone,

I’m having trouble with a timer that should work across multiple screens in my app.

Goal:

I want to start a timer on Screen 2, then navigate to Screen 3 while the timer continues to run in the background, and finally go back to Screen 2, where the timer should resume normally (showing the correct time passed), not restart or freeze.

Issues I’m facing:

  • In some cases, the timer is frozen when I return to Screen 2.
  • In other cases, it’s not frozen, but it resumes from the same point as when I left Screen 2, as if no time passed in the background.

What I’ve tried:

I’ve tested different combinations of blocks, but I can’t get it to:

  1. Continue running in the background** when I change screens, or
  2. Recalculate the elapsed time** when returning to Screen 2 to simulate a continuously running timer.

What I’m looking for:

A reliable way to make a timer work across different screens, even when leaving the main screen where it was started.
Has anyone encountered this before or found a clean solution? Maybe using a timestamp method (storing the start time, then calculating the difference when coming back)?

Thanks a lot for your help!

I have a similar function. I was having the opposite problem, that I needed the timer to restart for each screen. Found a solution but I’ll try to remember what it was like before to help you.

So each screen has a varible “Initialize app variable timer to _#__

That number (from the math box) is how many seconds the screen starts at. In your case, the first screen may be 0.
blablahblah

ok chatgpt helped me build mine you should try asking it ._. if you want to see my blocks you can email me at rukusflashchords@gmail.com

Subtract the current seconds since 1970 (using this block) from the seconds since 1970 when Screen 2 opens (store that value in a variable). That will give you an updated timer value at all times across multiple screens.