Key Hold Duration Test

Hold a chosen key and release it repeatedly to measure the duration of each browser keyboard event.

Key and sample settings

Use a code such as Space, KeyA, or ShiftLeft. Tab is not captured.

Use 5–100 valid presses. Ten to twenty samples are a practical starting point.

Start a test Set the target key and sample count, then start. Tab is not captured.
Samples
0 / 20
Key currently held
Last duration
Outside thresholds
0
Progress0%

PhaseWaiting to start

Set the target key and start a test.

Hold duration result Waiting for samples
Median hold duration Set the target key and start a test.
Mean
MAD
Outside thresholds

Complete at least one valid press to see results; 10–20 samples are useful for a steadier comparison.

Consistency of key holds

Hold-duration series

The line shows each complete sample and the dashed line marks this round's median.

More information

Method, formula, and result meaning

A sample is H = keyup timestamp − first non-repeat keydown timestamp. Auto-repeat does not create a new sample; median, P10/P90, and MAD use the same complete event pairs.

Unrounded millisecond values are kept internally. The page shows one decimal place and thresholds use the original values.

For fixed 100, 200, and 300 ms samples, the median is 200 ms. Auto-repeat does not increase the sample count, and a press without keyup is discarded.

Usage and limitations

The test captures only the selected KeyboardEvent.code. System shortcuts, browser-reserved keys, and special device keys may not be captured; focus loss discards unfinished keyups; scheduling affects timing.

How is key hold duration measured?

Each valid sample is the keyup timestamp minus the first non-repeat keydown timestamp for the same key. Auto-repeat does not create another sample.

What happens when keyup is missed?

If the page loses focus, an unfinished press is discarded and completed samples remain. This prevents a later event from being paired incorrectly.

What does MAD mean for key timing?

MAD is the median absolute deviation from the sample median. A smaller value usually means this round is more consistent, not that the hardware is better.

Tool information and sources

All keyboard events and statistics are processed in this browser. Nothing is uploaded, no remote API is called, and no URL or local storage is written.

The tool uses no third-party runtime code or assets; its algorithm and interface are independently implemented.

Standards and method sources