# Workout Timer on the Lock Screen and Dynamic Island

> A workout timer on the lock screen has to survive iOS suspending the app. Here is the drift, worked through in rounds, and what Live Activities can do.

Source: https://userounds.app/blog/workout-timer-lock-screen

Yes, a workout timer can run on the Lock Screen, keep perfect time with the screen off, and show the round and countdown on the Lock Screen and in the Dynamic Island while it does, and Rounds does it through a Live Activity. Whether the one on your phone manages it comes down to a single implementation choice you cannot see from an App Store listing: does it count seconds as they pass, or does it work out where it is from the clock.

iOS suspends an app within seconds of the screen locking. Everything about interval timers on iPhone follows from that one fact.

## The moment your screen goes dark

When your app leaves the foreground, the system gives it a short window to tidy up and then stops giving it CPU time. Apple's documentation puts that window at approximately 5 seconds, and an app that overruns it is terminated and purged from memory. After that the app is suspended. It stays in memory, and it does not execute.

Suspended means every loop inside the app stops. A repeating timer firing 60 times a second and adding to a counter stops adding. A progress value advanced frame by frame stops advancing. The wall clock keeps moving while the app is frozen.

There is no setting that turns this off, and none of it is a bug. It is how a phone in your pocket survives an afternoon. 2 background modes let an app keep doing narrow, declared work while suspended elsewhere, and audio playback is one of them. That is why interval cues can still reach your headphones. Running arbitrary code to count rounds is not one of them.

## Drift, worked through round by round

Take a standard Tabata: 8 rounds of 20 seconds of work with 10 seconds of rest, 4 minutes in total. It starts, you get through the first round and a bit, and at 30 seconds you lock the phone and set it on the bench. 2 minutes later you pick it up.

The app got roughly 5 more seconds of execution after the lock, then froze. Here is where the 2 kinds of timer are, second by second.

| Wall clock since start | Where the session actually is | Where a ticking timer shows you |
| --- | --- | --- |
| 0:30 | Round 2, work, just started | Round 2, work, just started |
| 0:35 | Round 2, work, 5s in | Round 2, work, 5s in, then frozen |
| 1:30 | Round 4, work, just started | Round 2, work, 5s in |
| 2:30 | Round 6, work, just started | Round 2, work, 5s in |

You wake the phone at 2:30 and the correct answer is round 6. A ticking timer tells you round 2 with 15 seconds of work left, and then carries on from there as though nothing happened. It is 4 rounds and 115 seconds behind the world, and the error always runs the same direction: it hands you rest you did not earn and stretches a 4-minute finisher into something else.

On a 40-minute circuit with 2 or 3 pocket checks along the way, the same mechanism turns into minutes of accumulated drift, and by then you have no idea which round is real.

## The fix is to stop counting

A timer that survives suspension never counts anything. It records the wall-clock instant you pressed start, expands the whole workout into a list of phases up front, and answers every question by subtraction.

Which phase am I in? Take the current time, subtract the start instant, walk the phase list until the elapsed seconds land inside one. How many seconds are left? The end of that phase minus now. Which round is this? A property of the phase you landed in. All 3 answers are pure functions of elapsed real time, with no state that can fall behind, because there is no state.

Freeze that app for 2 minutes, for 10 minutes, or for the length of a phone call, and it returns to precisely where the clock says it should be, because the answer was always a calculation on the current time. This is how [Rounds](https://userounds.app) works, and it is the reason its timer engine has no ticking loop anywhere in it. Audio cues are scheduled against that same timeline in advance, so the beeps arrive on time even while the app is asleep, which is the other half of the problem covered in the [HIIT timer guide](/blog/hiit-timer-iphone).

## The visible half: Live Activities

Correct timekeeping is worth nothing if you have to pick the phone up and sign in to read it. That is what Live Activities are for, available since iOS 16.1.

A Live Activity is a small piece of your app's interface that the system renders on the Lock Screen and, on iPhones that have one, in the Dynamic Island. The important trick for a timer is that SwiftUI can display counting text from a date interval, so you hand the system a start and end date once and it animates the digits itself. The countdown on your Lock Screen keeps moving while your app is suspended, because the app is not the thing drawing it.

Here is what a Live Activity can and cannot do for a workout timer.

| Capability | Available | Detail |
| --- | --- | --- |
| A countdown that keeps ticking | Yes | The system renders timer text from a date range without waking your app |
| Current phase, round and set | Yes | Your app pushes a new state; static and dynamic data together cap at 4 KB per update |
| Pause, skip and stop buttons | Yes, iOS 17 and later | SwiftUI buttons and toggles driven by an App Intent. They do nothing in CarPlay |
| Fetching data itself | No | Each Live Activity runs in its own sandbox, with no network and no location access |
| Running indefinitely | No | 8 hours active, then the system ends it and clears the Dynamic Island at once |
| Lingering after it ends | Partly | Up to 4 further hours on the Lock Screen, 12 hours from start in the worst case |

2 limits get quoted at people who do not need them. The 8-hour ceiling is real and irrelevant to a gym session; it exists for flight trackers and food deliveries. The update budget is real too, and it applies to updates pushed from a server through APNs, which get throttled if an app is greedy. A workout timer updates its own Live Activity locally while the phase changes, and the countdown between phases redraws itself, so a well-built one sits nowhere near either limit.

## Sound is a separate mechanism

Live Activities are visual only. Audio comes from declaring the audio background mode and holding an active playback audio session. That keeps the app producing sound with the device locked and the Ring/Silent switch flipped. An interval timer needs both halves: the audio session so you can hear the transitions with the phone face down, and the Live Activity so a glance tells you the round.

If a timer has one and not the other, you can feel it. Cues with no Lock Screen display means picking the phone up to find your place. A Lock Screen display with no reliable audio means watching the screen through the work interval, which is the interval you are meant to be spending at full effort.

## Test the timer you already have

This takes 4 minutes and settles the question for any app on your phone.

1. Set up an 8-round Tabata: 20 seconds of work with 10 seconds of rest and no preparation countdown.
2. Press start and let round 1 run.
3. Lock the phone at around the 30-second mark and put it face down.
4. Wait 2 full minutes. Listen for whether the cues keep arriving.
5. Wake the phone and read the round number.

At 2:30 into the session, a correct timer shows round 6. Anything showing round 2 or 3 has been counting instead of calculating, and it will do the same thing to every session you run with it. While the phone is locked, glance at the Lock Screen: a timer with a Live Activity shows the phase and a moving countdown without you touching anything.

Run that test before a session that matters, not during one. It is also the fastest way to sort a shortlist, which is roughly how the [interval timer comparison](/blog/best-interval-timer-app-iphone) is put together.

Rounds is in open beta through TestFlight at [userounds.app](https://userounds.app), built so that the phase timeline is computed from the wall clock and mirrored to the Lock Screen and the Dynamic Island. Whatever you end up using, run the 4-minute test on it first.
