Stopwatch

A stopwatch with laps that stays right when you switch tabs. Most browser stopwatches count ticks from a timer, which drifts — a browser fires an interval no sooner than you asked, never exactly on it, and the shortfalls add up. Worse, browsers throttle background tabs to one tick a second and then roughly one a minute, so a tick-counting stopwatch left running in a hidden tab quietly stops counting. This one reads the clock and subtracts, so the interval only triggers a repaint and the reading is correct however rarely it fires. It uses a monotonic clock too, so a system time change cannot make it run backwards.

Why tick-counting fails

SituationTick counterThis
Running an hourDrifts seconds behindExact
Tab in backgroundNearly stopsExact
Busy main threadLoses timeExact
System clock changesCan jumpUnaffected

When to use it

  1. Time a workout or a set of intervals.
  2. Time laps in a race or a practice run.
  3. Time a task while working in another tab.
  4. Measure how long something actually takes.
  5. Time a presentation rehearsal.

How to Use

  1. Press start, or hit space.
  2. Record laps as you go — the split and the total are both shown.
  3. Stop, and read the fastest and slowest laps.

Features

  1. Reads the clock, so it never drifts
  2. Correct in a background tab
  3. Monotonic clock, immune to system time changes
  4. Laps with splits and totals
  5. Fastest and slowest highlighted
  6. Keyboard control
  7. Nothing transmitted

FAQs

Does it keep running if I switch tabs?

Yes, and correctly — which is the main reason to use this one. Browsers throttle background tabs so heavily that a tick-counting stopwatch stops counting entirely. This reads the clock, so switching away and back gives you the true elapsed time rather than the time the tab happened to be visible.

How accurate is it?

As accurate as the browser's clock, which is far better than millisecond precision for this purpose. The display is limited to hundredths, deliberately — three digits changing at once is unreadable while it runs, and a stopwatch exists to be read while running.

What happens if I close the tab?

It stops and the laps are lost. Nothing is stored on a server and nothing survives a reload, which is the trade for a tool that needs no account and sends nothing anywhere.

What is the difference between the lap and the split?

The split is the time since the previous lap; the total is the time since you started. Both are shown, since a runner wants the lap and a timekeeper wants the total.

Why does the fastest lap get highlighted?

Because it is the thing you were timing for. The fastest and slowest appear once there are at least two laps — with one, it is both and highlighting is meaningless.

Can I use the keyboard?

Space starts and stops, L records a lap, R resets. Reaching for a mouse costs a tenth of a second, which matters when that is what you are measuring.

Technical Details

The elapsed time is read from the clock, never counted from ticks, and that single decision is what separates a stopwatch that is right from one that looks right. `setInterval(fn, 1000)` does not fire every second — it fires no sooner than a second, and whatever the browser was busy with is added on. Those shortfalls accumulate, so a counter incremented on each tick drifts seconds behind over an hour and there is no way to recover the lost time because it was never recorded. Worse, browsers deliberately throttle background tabs: intervals are clamped to one a second when the tab is hidden and, in Chrome, to roughly one a minute after five minutes. A tick-counting stopwatch left running while you work in another tab simply stops counting, then resumes as though no time had passed. Storing the start timestamp and subtracting it on each repaint makes both problems vanish — the interval becomes nothing but a repaint trigger, and the reading is correct no matter how badly or rarely it fired. Pausing records the accumulated duration and resuming sets a new start, so the same arithmetic survives any number of pauses. `performance.now()` is used rather than `Date.now()`, because it is monotonic: a system clock adjustment, an NTP correction or a daylight-saving change can move `Date.now()` backwards and produce a negative elapsed time mid-measurement, which is a rare but genuinely possible way for a stopwatch to report nonsense. Display is hundredths rather than milliseconds, because three digits changing simultaneously cannot be read while running and a stopwatch is meant to be read while it runs. Laps are stored as cumulative marks and converted to splits for display, since both are wanted and only one can be recorded without drift.

Productivity Tools

Productivity Tools

  • Pomodoro Timer
  • ATS CV Generator
  • Checklist & To-Do Maker
  • Countdown Timer
  • Mind Map Maker
  • Bank Statement to CSV
  • Invoice Generator
  • Semantic Search in Your Files