Between a hand moving a mouse and light leaving a subpixel, a stroke passes through some thirty representations: sensor counts, a USB report, a desktop coordinate, an image coordinate, four bytes, a shader output, a position in the raster scan, link symbols, a row and a column, a voltage or a current, and finally a spectrum. This companion times that chain. Each stage is either work, which costs a fixed time, or a wait for a clock that runs independently of the hand: the USB poll, the application's frame, the display's vertical blank, and in a window the compositor's refresh after it. Waits for independent clocks are uniform between zero and the clock's period, so latency is a constant plus a sum of uniform variables, and its exact distribution is a convolution. With no fitted constant, the model reproduces photodiode measurements of a windowed application by Casiez et al. (2017) to within 2% at 60 Hz and 9% at 120 Hz, and the 15.5 and 15.9 ms they saved by doubling the refresh rate to within 8%. It falls 5 ms short on Windows at 144 Hz, which locates something the model does not contain.
Every stage on the path either does something or waits for something.
Work takes a time set by the work itself:
Waiting is for a periodic clock that is not synchronised with the hand:
A click arrives at a random phase of each clock, so it waits a time uniform on $[0, P_i]$. With fixed costs $c_j$:
$$L = \sum_j c_j + \sum_i U_i,\qquad U_i \sim \mathcal{U}(0, P_i),$$
$$\mathbb{E}[L] = \sum_j c_j + \sum_i \frac{P_i}{2},\qquad \operatorname{Var}[L] = \sum_i \frac{P_i^2}{12}.$$
The fixed costs move the distribution and do not widen it; all of the spread comes from the clocks. The exact density is the convolution of the uniform boxes, shifted by the fixed costs. The playground computes it on a 10 µs grid, in linear time per box from running sums, and checks it against a Monte Carlo sampler of the same stages. For every preset the two agree to within 0.1% in the mean and at the 95th percentile, over 200 000 sampled clicks.
| stage | kind | time |
|---|---|---|
| sensor and firmware | work | a constant per device |
| USB polling | wait | uniform over 1/f |
| radio link | wait | uniform over the connection interval, plus a constant |
| kernel and input stack | work | a constant |
| application draws (event-driven) | work | a constant |
| wait for the next frame (frame loop) | wait | uniform over the frame interval |
| CPU and GPU render (frame loop) | work | CPU time plus GPU time |
| frames queued ahead | work, of earlier frames | queued frames × frame interval |
| wait for the vertical blank | wait | uniform over the refresh period, or the remainder of a refresh |
| compositor | work, quantised | one refresh period |
| scanout to the row | work, quantised | blanking + row × active scan |
| wait for the beam (vsync off) | wait | uniform over the refresh period |
| monitor processing | work | a constant |
| pixel response to 50% | work | (ln 2/ln 9) × the 10-90% response time |
| strobe (instead of scanout and response) | work, quantised | one refresh + (ln 10/ln 9) × the response time |
An application drawing in a composited window waits half a refresh, on average, for the vertical blank at which its buffer is latched. The compositor composes the desktop from it on that refresh, and the result is scanned out on the next. The scan then reaches the row some fraction of a refresh later. At 60 Hz, for a row in the middle of the screen, that is
$$\tfrac12 \cdot 16.7 + 16.7 + \left(0.46 + \tfrac12 (16.7 - 0.46)\right) = 33.6 \text{ ms}$$
before the monitor has processed anything or the pixel has started to change. The 0.46 ms is the minimum vertical blanking time of VESA's reduced-blanking timings.
Casiez, Pietrzak, Marchal, Poulmane, Falce and Roussel (2017) measured end-to-end latency with a vibration sensor under the mouse button and a photodiode on the screen, with software probes at the HID report, the system event, the toolkit event and the repaint.
The setup. A Logitech G9 mouse polled at 1000 Hz, a C++/GLUT application in a window on macOS, and a Dell S2716DG monitor.
The model's inputs. The mouse was set from their probes: 0.6 ms to the HID report, 1.4 ms more to the repaint. The monitor's G-SYNC module is taken to add no processing, and its TN panel's transition is taken as 1 ms.
| case | measured | model | error |
|---|---|---|---|
| windowed GLUT, 60 Hz | 36.6 ms | 35.9 ms | 2.0% |
| windowed GLUT, 120 Hz | 21.1 ms | 19.2 ms | 8.9% |
| saved by doubling the refresh, GLUT | 15.5 ms | 16.7 ms | 7.5% |
| saved by doubling the refresh, Qt | 15.9 ms | 16.7 ms | 4.8% |
| windowed GLUT, Windows 10, 144 Hz | 21.4 ms | 16.4 ms | 23% |
The difference between refresh rates is the sharpest test, because every fixed cost cancels in it. What remains is the number of refresh periods a click spends on the display side: two, in the model, for a composited window and a mid-screen row. The measurements imply 1.86 (GLUT) and 1.91 (Qt).
On Windows the model is 5 ms short at 144 Hz, about three-quarters of a refresh. That compositor adds more than the model's one refresh, or more fixed time. The model does not hide this: it is a calibration case.
Every wait on the display side is a fraction of a refresh, so latency falls as one over the refresh rate. For the office configuration in the playground (a 125 Hz mouse, a composited window, 2 ms of monitor processing):
| refresh | mean | 90% of clicks |
|---|---|---|
| 60 Hz | 45.1 ms | 36.5 to 53.8 ms |
| 120 Hz | 28.5 ms | 22.9 to 34.1 ms |
| 144 Hz | 25.7 ms | 20.6 to 30.8 ms |
| 240 Hz | 20.1 ms | 15.9 to 24.4 ms |
| 480 Hz | 16.0 ms | 12.2 to 19.7 ms |
The first doubling saves 16.7 ms and the last saves 4.2 ms; from 240 Hz on, the fixed costs are most of what is left. In the same configuration, the present mode changes the mean as follows:
With vsync, the display draws top to bottom: a row is reached at blank + row × (period − blank) after the flip. In the office configuration, a stroke at the top of the screen reaches the light at 37.0 ms on average, and one at the bottom at 53.2 ms. The playground reads the row from where the stroke is on the physical screen.
With vsync off, the buffer is flipped mid-scan and the row updates on the scan's next pass. That is a uniform wait of up to one refresh, whatever the row, and the frame shows a tear where the two images meet.
A strobed backlight stays dark while the panel is scanned and the crystal turns, then flashes once; the transition is hidden and motion is sharp. The light waits for the whole panel to be scanned and settle, so the row stops mattering and the full scan is always paid. In the strobe preset at 144 Hz:
| row | without strobe | with strobe | cost |
|---|---|---|---|
| top | 21.6 ms | 31.0 ms | 9.4 ms |
| middle | 24.8 ms | 31.0 ms | 6.2 ms |
| bottom | 28.1 ms | 31.0 ms | 2.9 ms |
A USB mouse does not send its report; the host polls for it. A report that is ready waits for the next poll, uniformly within one polling interval. That interval is in the device's descriptor, and in practice it is rounded down to a power of two (Wimmer et al. 2019).
At 125 Hz the wait has a mean of 4 ms and a standard deviation of $8/\sqrt{12} = 2.31$ ms. Casiez et al. measured the time from the button press to the HID report of a Logitech G9 at each polling rate:
| polling | measured SD | model SD |
|---|---|---|
| 125 Hz | 2.1 ms | 2.31 ms |
| 250 Hz | 1.3 ms | 1.15 ms |
| 500 Hz | 1.0 ms | 0.58 ms |
| 1000 Hz | 0.9 ms | 0.29 ms |
At 500 and 1000 Hz the measured spread stops falling near the method's stated precision of about a millisecond, so only the first two rates are calibration cases.
The mean. Going from 125 to 1000 Hz saved 3.4 ms end to end, against the 3.5 ms difference of the mean waits.
For the office configuration, the polling rate moves the mean from 45.1 ms at 125 Hz to 41.6 ms at 1000 Hz and 41.2 ms at 8000 Hz. In the sensitivity analysis, one step of polling rate is worth 2 ms. Multiplying or dividing the refresh rate by 1.5 is worth 27.8 ms, and moving the stroke from the top of the screen to the bottom is worth 16.2 ms.
A game reads input once per frame, so the click waits up to a frame interval to be read, then for the CPU and GPU to render. With vsync, a frame that starts on a vertical blank is shown on the first blank at least one render time later. If the render takes longer than a refresh, the frame interval is quantised to whole refreshes.
If the CPU can prepare frames faster than they are consumed, by the GPU or by the display, the queue between them fills to its limit. Every input then waits behind the frames already in it.
The GPU-bound preset needs 12 ms of GPU time per frame at 144 Hz, so it shows a frame every 13.9 ms: two refreshes, 72 frames a second. With three frames allowed in flight:
Driver settings for maximum pre-rendered frames, and low-latency modes, exist for this reason.
Swept over GPU time with the same queue of three, latency rises in steps as the frame interval crosses each multiple of the refresh period. It is 38.7 ms up to 6.9 ms of GPU time, 56.1 to 63.0 ms up to 13.9 ms, and 80.4 ms beyond. This is the threshold the playground's classification refers to.
| configuration | mean | largest stage |
|---|---|---|
| 360 Hz OLED, 8000 Hz mouse, vsync off | 8.5 ms | CPU and GPU render, 4.5 ms |
| 144 Hz VRR game | 18.9 ms | CPU and GPU render, 8.0 ms |
| 60 Hz windowed paint program | 45.1 ms | compositor, 16.7 ms |
| GPU-bound, queue of three | 63.0 ms | queued frames, 27.8 ms |
| console on a television, picture processing on | 123.4 ms | monitor processing, 50 ms |
The television's game mode, modelled as cutting processing from 50 to 5 ms, takes the last case to 78.4 ms.
Perception thresholds for latency depend on the task and the device:
These thresholds are drawn on the playground's distribution, labelled with their task and device. They are not interchangeable, and none of them is a property of the display alone.
A web page cannot see the mouse, the cable, the monitor or the light. It does see three clocks:
The playground's probe records all three while the canvas is drawn on. It plots the frame wait in units of the measured refresh period against a uniform distribution, and gives the Kolmogorov-Smirnov distance with its 95% band. A page that is busy with other work, or a browser that coalesces input differently, will show it there.