Measuring Key Depression and Input Latency in 2026
- Total input latency from key press to browser event is typically 5–15ms on modern hardware.
- This is well below human reaction time (~150ms) and doesn't affect WPM measurement.
- The main latency components are: key travel, USB polling rate, OS processing, and browser dispatch.
- Wireless keyboards add 10–50ms with cheap 2.4GHz dongles — this is the one hardware factor that can affect scores.
- performance.now() timestamps the browser event, not the physical key press — so it records when the browser sees the keystroke, not when your finger depressed the key.
The Latency Chain
Every keystroke passes through several stages before it becomes a JavaScript event in the browser. Each stage adds a small delay. Here's the full chain:
| Stage | Typical latency | Variability |
|---|---|---|
| Key travel (switch activation) | 1–4ms | Low (deterministic) |
| USB keyboard polling | 1–8ms | Set by polling rate (1000Hz = 1ms, 125Hz = 8ms) |
| Wireless keyboard dongle (if applicable) | 1–50ms | High — varies by quality |
| OS input processing | ~1ms | Very low |
| Browser event dispatch | ~1ms | Low |
| JavaScript event handler execution | <1ms | Very low (depends on page load) |
Total for a wired keyboard on a modern system: approximately 5–15ms end-to-end. This is well below the 150ms human reaction time threshold and has no measurable effect on WPM scores.
What performance.now() Actually Timestamps
An important technical detail: performance.now() in a keydown event handler records when the browser received and dispatched the event — not when your finger physically depressed the key. The difference is the accumulated hardware and OS latency (5–15ms on typical wired setups).
For WPM measurement purposes, this is irrelevant — the start and end of the test both use the same timestamp reference, so the absolute latency cancels out. For inter-keystroke interval (IKI) analysis in anti-cheat systems, the consistent latency from a single keyboard also cancels out, because what matters is the variance in IKI, not its absolute value.
USB Polling Rate Explained
USB keyboards report their state to the computer at a fixed polling rate. A keyboard polling at 1000Hz (1ms intervals) reports up to 1000 times per second. One polling at 125Hz (the most common rate for cheap keyboards) reports only 125 times per second — adding up to 8ms of potential latency.
For typing tests, even 8ms polling latency is imperceptible and doesn't affect scores. It matters more in gaming contexts where reaction times are measured in milliseconds. Gaming keyboards typically poll at 1000Hz or faster; standard office keyboards often poll at 125–250Hz.
When Hardware Latency Actually Matters
There is one scenario where hardware latency matters for typing scores: cheap wireless keyboards using 2.4GHz dongles. These can introduce 20–50ms of inconsistent latency per keystroke, which can occasionally cause keystrokes to be recorded out of order or missed entirely at very high typing speeds (100+ WPM). The fix is a wired keyboard, or a wireless keyboard specifically designed for low latency (these poll at 1000Hz+ wirelessly).
For most typists below 100 WPM, no keyboard on the market introduces enough latency to affect scores meaningfully. See whether keyboard quality affects typing test speed for the hardware choice question from a non-technical angle. For how all of this connects to the browser's timing API, see handling keyboard events in JavaScript.
¿Listo para ponerlo en práctica?
Haz una prueba de mecanografía gratuita y empieza a hacer seguimiento de tu progreso.
Prueba de mecanografía gratuita →