Skip to content
EN
Get in touch

On Time

Five durations, each from a measured human threshold, cover a whole codebase: how every timeout, cadence and animation is set, and why no sixth is allowed.

By Bogdan Vladoiu, 2026-11-02

Most codebases carry hundreds of durations. A 300 millisecond debounce here, a 5 second timeout there, a 2 second splash, a retry that doubles from 100 milliseconds to 1,600. Each one was reasonable on the day it was typed. Together they are noise: nobody can say what any of them protects, so nobody dares change one, and the same wait is tuned three different ways in three files.

ComputeShack's code has five. Every duration in the house is one of them, or a small multiple of one written where it is used. This article is the ladder, the evidence for each rung, and the rules that keep it at five.

The rungs

Rung Value What it is
JITTER 22 ms Below this, two events feel simultaneous.
MILLER 90 ms Below this, a response feels instantaneous.
DOHERTY 360 ms Below this, the user stays in flow.
HANG 4.5 s Past this, the user decides the program is dead.
TIMEOUT 9 s Past this, the user gives up on the task.

Each value is a published human threshold reduced by about ten percent, so that work resolves under the threshold rather than at it.

JITTER comes from audio and tactile research: people notice timing wobble at about 25 milliseconds, and tap-latency studies land on the same figure. MILLER is Miller's 1968 observation that anything under 100 milliseconds reads as immediate. DOHERTY is the 400 millisecond point IBM measured in 1982, below which a person keeps their train of thought. HANG is the point where Windows itself declares a window hung and greys it out, five seconds without a message pump. TIMEOUT is twice HANG, from a 2000 CHI study in which quality ratings collapse between 8 and 10 seconds. The folklore "8 second rule" was a vendor white paper and is not the source.

One more number sits above the ladder, not on it: a twenty minute fleet quantum. Heartbeats, token lifetimes and the resync of a sitting client all use it, so tuning staleness tunes every side at once.

How a rung is used

A rung is not a timeout. It is a budget that a kind of work must fit inside.

  • Anything that answers a tap must commit before DOHERTY. A screen transition animates for DOHERTY, so it finishes under the window rather than on it.
  • Work that cannot be done in 400 milliseconds does not block. It suspends, and the screen shows what it has.
  • A local resource, such as a busy database file, gets HANG of patience and no more.
  • Every network call that dials, asks and answers gets TIMEOUT. There is one deadline for all of them, so a slow backend fails the same way everywhere and the user learns one behaviour.
  • A pump that lives for the life of the process gets no bound at all. A bigger number is never the answer.

Multiples are allowed at the call site when they have a reason: three missed heartbeats before a peer is declared dead, because detection is a ratio and not a tier.

What was kept out

The ladder is as useful for what it refuses as for what it holds.

  • No one second rung. Flow is a real threshold, but the only thing it would gate is a splash screen, and the house does not have splash screens. An app opens on its main screen, and a user reopening it ten times in a row never waits.
  • No frame rung. Frame time belongs to the toolkit and the compositor. Code above them cannot beat it and should not pretend to.
  • No gesture rung. Long-press is 400 milliseconds on Android and something else elsewhere. It must match the host, so it is never a shared constant.
  • No exponential backoff. Pollers have two states: a busy cadence in their workload's own tier while events flow, and a relaxed DOHERTY cadence when cold. The first event ramps them back up. A poll that doubled from 100 to 1,600 milliseconds became a flat DOHERTY poll against the TIMEOUT budget, and nobody missed it.

Why five is the right number

A duration with a name and a source can be defended. When the question comes, "why does this wait nine seconds", the answer is a study, not a shrug. When the threshold research moves, one constant moves with it and every caller follows.

A duration without a name cannot be defended, only copied. That is how a codebase ends up with hundreds.

The same holds for people and for agents writing into the same code. A rule that says "use a rung or a multiple of one" is one a reviewer can check in a glance, and one a model can follow without judgement. "Pick a sensible timeout" is neither.

Applying it

Start by listing every literal duration in the project. Most will cluster around the rungs already, because they came from the same human limits. Replace each with the rung it was approximating. The ones that do not fit are the interesting ones: each is either a multiple with a reason, a product decision that deserves its own name and a comment on why, or a mistake.

Then write the rule down where it cannot be missed, and refuse the sixth rung until someone brings a study.

ComputeShack

Small, good solutions.

[email protected]

Privacy policy · © 2026 ComputeShack