A little help goes a long way. Find a tool/

Time FIELD NOTES · 4 MIN READ

How a Focus Timer Works: One Countdown, One Commitment

The anatomy of a single countdown: duration to seconds, the end-time estimate, midnight wrap-around, and why a bounded block works.

A focus timer is the simplest timer there is: one duration, one countdown, one commitment. That simplicity is the feature. The ticking is almost incidental — what the tool actually does is turn "I should work on this for a while" into a number you entered on purpose, and then hold you to it.

From duration to total seconds

Everything starts with one piece of arithmetic. You give a duration in hours, minutes, and seconds, and the timer collapses it into a single count of seconds:

total = hours × 3600 + minutes × 60 + seconds

25 min          →  1,500 seconds
1 h 30 min      →  3,600 + 1,800 = 5,400 seconds
24 h            →  86,400 seconds (one whole day)

The single number is what the countdown actually ticks down, and it is worth glancing at. "90 minutes" is an abstraction; 5,400 seconds feels like a real chunk of your day, which is partly the point of setting the block in the first place. The Focus Timer shows both views — a friendly label like 1h 30m and the padded clock form 01:30:00, where every field is two digits so the display never jumps around as the seconds tick.

The end-time estimate

Optionally, you can give a start clock time. The timer adds the duration to it and reports when the block will end: start at 13:15 with 90 minutes and you finish at 14:45. Under the hood that is clock arithmetic on seconds — convert the start time to seconds since midnight, add the duration, and wrap around midnight:

end = (start + duration) mod 86,400

23:40 + 45 min  →  85,200 + 2,700 = 87,900 → 1,500 s →  00:25:00

That wrap-around case is not a corner case — it is the normal case for anyone who works late. A block started at 23:40 for 45 minutes ends at 00:25 the next calendar day, and the estimate shows exactly that. The estimate also serves a second purpose: it is the one durable output of the session. If the tab disappears, you still know when the block was due to end.

Why one block beats a vague intention

A countdown is a commitment device. "Work on the report" can expand to fill the day; "work on the report until this timer hits zero" has an edge. The mild deadline a countdown creates is oddly effective at crowding out distraction, because the question changes from do I feel like continuing? to what fits in the remaining time? The duration is an input you chose — that is the whole psychology.

How a focus timer differs from its neighbors is a question of shape, and the timer comparison guide covers the full decision: a stopwatch measures open-ended time, a Pomodoro adds a repeating break script, and a focus timer bounds a single task. If your problem is not starting but stopping — work that bleeds into breakless marathons — the structured version is a better fit; the method behind it is in the Pomodoro Technique guide.

Why the timer resets when the tab closes

This timer runs entirely in your browser. The countdown lives in the open page — nothing is sent anywhere, and nothing is stored on a server. The flip side is that refreshing or closing the tab ends the countdown, and reopening starts from the full duration again. Treat the estimated end time as your backup: jot it down when you start, and the wall clock can finish the job if the tab gets closed by accident.

The edges: one second to one day

The accepted range runs from any nonzero duration up to exactly 24 hours — 86,400 seconds, the number of seconds in a day. One second more is rejected, as is zero. Within that range everything is legal: a 10-second sprint to test the workflow, or a full-day block for a long-running task. The default is 25 minutes, the classic single-block length, but nothing about the tool assumes it.

Try it yourself

Set the Focus Timer for one bounded task — 25 minutes is the default — enter a start time, and watch the end-time estimate turn the commitment into a clock time. If one block is not enough structure, schedule several with breaks on the Pomodoro Timer. And to find out how long your recurring tasks actually take, measure a few with the Stopwatch and size your future blocks from the average.

Frequently asked questions

How is a focus timer different from a stopwatch or a Pomodoro timer?
A focus timer counts down a duration you chose in advance — it commits you to a block. A stopwatch counts up to measure how long something took, and a Pomodoro timer adds a repeating script of focus blocks and breaks on top of the countdown. The full comparison, including when each tool is the right one, is in the guide to choosing a timer.
How does the end-time estimate work when the block crosses midnight?
The start time and duration are both converted to seconds, added together, and wrapped with a modulo of 86,400 — the number of seconds in a day. A block started at 23:40 for 45 minutes therefore ends at 00:25 the next morning, and the estimate shows exactly that wrapped time.
What happens if I close or refresh the tab?
The countdown lives in the open page, so refreshing or closing the tab resets the timer to the full duration. Note the estimated end clock time when you start — it is the durable record that survives even if the tab does not.
How long can a focus block be?
Up to exactly 24 hours — 86,400 seconds, one full day. A duration of 24 hours and 1 second is rejected, as is zero. Within those limits anything goes, from a 10-second test run to a full-day block.
Is there an API for the focus timer?
Yes. POST to /api/focus-timer with hours, minutes, seconds and an optional startTime (HH:MM) to get back the total seconds, the padded HH:MM:SS display string, and the estimated end time as JSON. No authentication is required and CORS is enabled.