Skip to content
TimerWorks

A timer that doesn't drift

Deadline-based timing, so background tabs cannot make it wrong. The alarm is armed when you press start, and the page tells you so.

00:00

Why online timers are usually wrong

Almost every timer on the web is built the obvious way: start an interval that fires once a second and subtract one from a counter. It works perfectly while you watch it, and fails as soon as you do anything else. Browsers deliberately throttle timers in background tabs to save battery — often to once a second, sometimes far slower — so the counter falls behind real time, and the further behind it falls the longer you leave it.

The fix is not to count at all. When you press start, this page records the exact clock time your timer should end. Every frame it asks the system clock how long is left. Throttling can make the display update less often, but it cannot make the answer wrong, because the answer was never being accumulated in the first place.

You can test this against any other timer: start both, switch to another tab for ten minutes, and come back. This one will agree with your watch.

The alarm is the part that actually has to work

Accurate timing is necessary but not sufficient, because the thing you rely on is the noise at the end. Scheduling that noise from a JavaScript timer does not survive a background tab: after roughly five minutes hidden, Chrome throttles the page's timers to about once a minute, so a countdown that beeps when its tick notices zero can be a full minute late. Late is the same as broken when it is your oven.

So the alarm is not scheduled from a JavaScript timer at all. The moment you press start, the tones themselves are queued on the browser's audio clock for the exact instant your timer ends. That clock lives on the audio thread and does not care about tab visibility, throttling or what the rest of the page is doing. Once start is pressed, the sound is already committed — the countdown you can see is just the display.

The alarm problem

The second common failure is silence. Browser autoplay policy blocks sound that was not initiated by a user gesture, and a timer that creates its audio at the end of the countdown has no gesture left to point at. The result is a timer that visibly reaches zero and makes no noise — the worst possible outcome, because you trusted it.

Here the audio pipeline is created and unlocked by the same click that starts the countdown, then verified, and the result is displayed under the controls. If it says the sound is armed, it will sound. If it does not, you find out at the start rather than the end.

Bookmark the timer you always use

Put the duration in the address: #25m, #5m, #1h30m. The page starts that timer immediately on load, so the timer you use every day becomes a bookmark or a shortcut rather than four clicks. Times can be written as 90s, 25m, 1h30m or 10:30.

How it works

Choose a preset or type a duration such as 90s, 25m, 1h30m or 10:30 (ten minutes thirty seconds), then press Start. TimerWorks does not count down one tick at a time. When you press Start it records the exact finish time, and each time the display updates it works out finish time minus now.

Browsers slow down timers in tabs you are not looking at — Chrome, for example, can limit hidden tabs to waking about once a minute — so a tick-counting timer drifts. Ours may show stale digits while hidden, but it still finishes at the right moment and corrects itself as soon as you look.

Browsers also block sound until you interact with the page. Pressing Start counts as that interaction, so the alarm is “armed” at that point and can play when time is up. Bookmark a link such as timer.amitsharma.co.nz/#25m to start a 25-minute timer straight away. The timer stops if you close the tab, and full-screen mode is there for classrooms and kitchens.

The timer runs in your browser and nothing you set is sent to us. This page also shows Google ads, which use cookies — see Privacy.

Worked examples

Worked example 1: what #1h30m means

  • 1 h = 60 min, so 1 h 30 min = 60 + 30 = 90 minutes
  • 90 × 60 = 5,400 seconds
  • Start at 2:15 pm and it finishes at 2:15 pm + 1 h 30 min = 3:45 pm

And “10:30” means 10 minutes 30 seconds: 10 × 60 + 30 = 630 seconds.

Worked example 2: why the finish-time method doesn’t drift

You start a 25-minute timer at 10:00:00 am.

  • Finish time recorded = 10:00:00 + 25:00 = 10:25:00 am
  • You switch tabs. At 10:12:30 the display updates: remaining = 10:25:00 − 10:12:30 = 12 min 30 s

It doesn’t matter how many updates the browser skipped while the tab was hidden; the subtraction is always against the real clock.

Questions

Does an online timer keep running in a background tab?
TimerWorks does. It records the finish time when you press Start and checks the real clock, so it still ends on time when the tab is hidden. Browsers slow updates in background tabs, so the digits may lag for a while if the tab has been hidden for several minutes, but they correct the moment you return.
Why do browser timers drift?
Many online timers count one-second ticks. Browsers deliberately slow timers in hidden tabs to save battery, and Chrome can limit them to roughly once a minute after a tab has been hidden for a few minutes. Missed ticks add up, so the timer falls behind. Calculating from a fixed finish time avoids the problem.
Why does the timer say sound armed?
Browsers block web pages from playing sound until you interact with them. When you press Start, TimerWorks uses that click to unlock audio, so the alarm can play when time is up even if you have switched tabs. "Sound armed" confirms this has happened. Check your device volume is up and the tab is not muted.
Can I bookmark a timer for 25 minutes?
Yes. Add the duration after a hash in the address, such as timer.amitsharma.co.nz/#25m, and bookmark it. Opening the bookmark starts a 25-minute timer straight away. The same works for other lengths, for example #5m, #90s or #1h30m. It is handy for routines you repeat every day, such as study blocks or cooking.
Does the timer keep going if I close the tab?
No. TimerWorks runs entirely in your browser tab, so closing the tab or the browser stops the timer and its alarm. Switching to another tab or app is fine; just leave the timer's tab open. On phones, some systems pause pages in the background more strongly, so keep the screen on for critical timings.
How do I set a timer for 1 hour 30 minutes?
Type 1h30m in the custom duration box and press Start, or open timer.amitsharma.co.nz/#1h30m to start it straight away. That is 90 minutes, or 5,400 seconds. You can also type durations as 90m. The display counts down and the alarm sounds when it reaches zero.
Can I use the timer in full screen?
Yes. Press the Full screen button to show large digits that fill the screen, which works well for classrooms, presentations, workouts and kitchens. Press Esc, or use your device's usual exit gesture, to leave full screen. The timer keeps running while you switch between full screen and the normal view.

Related free tools

Browser behaviour varies by device; for safety-critical timing use a dedicated device timer.