Stopwatch & Timer

Time anything — count up or count down.
00:00.00
Laps
No laps recorded yet.
05:00

How stopwatch and timer work

A stopwatch counts up from zero — useful for timing events, workouts, or experiments. A timer counts down from a set duration — useful for cooking, pomodoro sessions, or reminders. Both run in your browser using high-resolution timing APIs for accuracy.

The timing engine

Both features use performance.now(), which returns the time in milliseconds since the page loaded with sub-millisecond precision. Unlike Date.now(), which can be affected by system clock adjustments, performance.now() is monotonic — it always moves forward.

Elapsed = performance.now() − startTime

The display updates roughly 60 times per second using requestAnimationFrame(), which aligns with your screen's refresh rate. This is much more accurate than setInterval(), which can drift over time.

How lap recording works

Each lap records two values: the split time (how long just that lap took) and the total time (cumulative from the start). The split is the difference between the current time and the previous lap's timestamp. This lets you see both individual lap performance and overall progress.

The countdown timer

The timer stores a target end time — the moment it should finish — rather than counting down tick by tick. Each display update computes the remaining time as:

Remaining = endTime − performance.now()

This approach means the timer stays accurate even if the browser throttles background tabs or the display refresh rate drops. When the remaining time reaches zero, the timer plays a chime using the Web Audio API — no audio files needed.

Common questions

← Back to Your Online Helper