There is a bug class that every browser countdown walks straight into, and it only shows up in the one place these clocks are actually used: a room with two screens, a host, and a tab nobody is looking at.

The failure looks like this. A speaker is told she has two minutes left. The display in front of her still says six, because it has been drifting for the last half hour while she quietly dropped a slide and cut a story short to save time she did not need to save. No one in the room says anything, because in a room everyone assumes the agenda is behind, not that the clock is wrong.

The clock is wrong. Here is the version I shipped first.

let remaining = 900; setInterval(function () { remaining -= 1; draw(remaining); }, 1000); 

Nine hundred seconds. Subtract one on each tick, redraw, repeat. It is the first thing anyone writes, and if you watch it for eleven seconds it looks perfect. Then it goes into a real room and stops being a stopwatch, because a browser is not one, and the laptop running a presentation is the most interrupted machine in the building.

The tab the host isn't looking at

When a browser window is hidden or sitting behind another window, Chrome slows your timer down on purpose. Not slightly. After a while it checks on your page roughly once a minute instead of once a second. You subtracted one second. The clock lost about fifty-nine.

So here is the actual run: the host pulls up the control page, then switches to the slides, then to the sound panel, then to their mail client to fish out the room link, and from that moment on nobody is looking at the control tab. It keeps counting, just at a fraction of the speed it thinks it is counting. The speaker's display — a second device entirely — is still showing a number that is now several minutes optimistic. Everyone reads it. Everyone plans around it. The only number in the room that is wrong is the only number anybody trusts.

You do not find this by testing the way most people test, which is with the tab in front of you, open and focused — the one situation in which the bug cannot appear.

The lid

Second thing, smaller, and it can cost a full minute. Close a laptop during a coffee break, open it again, and the timer resumes from where it was frozen rather than from where it should have got to. Suspended timers do not tick. Whatever arithmetic you do per tick is arithmetic that doesn't happen.

Subtracting was the actual mistake

The throttled tab and the closed lid are symptoms. The design was wrong underneath them, and it took embarrassingly long to say that out loud instead of blaming the browser.

A countdown is not a quantity that shrinks. It is one moment, the one where the thing ends, and everything else is derived from it. So stop subtracting. Store the moment.

const endsAt = performance.now() + remainingSeconds * 1000; function frame() { const left = Math.max(0, (endsAt - performance.now()) / 1000); draw(left); requestAnimationFrame(frame); } 

Now it does not matter whether the last call was eight milliseconds ago or eight minutes ago. The number on the screen is computed fresh from the clock every time it is drawn. There is nothing left to accumulate, because nothing is being added up. A timer that recomputes can be late to draw but it cannot drift.

The piece that goes with it is this, and it is two lines that I originally left out:

document.addEventListener("visibilitychange", function () { if (!document.hidden) frame(); }); 

Coming back into view should not wait for the next scheduled tick to notice that time passed.

Then the colours, which is where it breaks a second time. Green, amber, red, then overtime, and the easy version advances them through a little state machine that gets nudged at each threshold. One pause is enough to skip the amber band entirely, so the display jumps from calm green to red with three minutes still on the clock. A speaker who sees red at three minutes left will panic and rush the ending, which is the exact opposite of what the colour was for. Colours have to be derived from the remaining time on every draw, the same way the digits are. Anything that is computed once and then remembered is another thing that can be wrong by minutes.

What actually took the longest

Not the arithmetic. The jump from one screen to two.

A host's control page and a speaker's display are two processes, on two devices, with two clocks and no shared memory. Fixing the maths in one of them is half a fix. Two clocks never agree exactly, and You can spend a while trying to make them agree before accepting that they won't. What matters is which one everybody in the room is looking at, and that is the big display, so the display has to be the thing that gives way. It reads the host's timestamp, corrects toward it, and stops trusting itself.

Which is also the answer to the obvious question: why not just use a phone timer. A phone timer only helps the person holding the phone. The speaker, the host, the person running the screen and the room itself are four different sets of eyes and they all need the same number. One private clock is not coordination. It is one person who knows what time it is.

I built the thing I wanted — host controls the clock, speaker gets a clean fullscreen display, the colour states do the interrupting so the host doesn't have to walk up and whisper, and once it goes past zero the overtime keeps counting in red instead of stopping at 00:00, because "how far over" is the number the next speaker actually needs.

If you want the thing rather than the notes, it's here: presentationtimer.org. Free to create a room, no account needed, and it works from a browser on whatever display you have in the room.

It's my own site, so take the recommendation with the discount it deserves. The bug above is the reason it behaves the way it does.