Latency vs jitter: what a browser network test can and cannot measure
For games and calls, a steady 40 ms often beats a jumpy 25 ms. A browser can measure response-time spread over HTTP; it cannot see game-server routes or packet loss.
執筆 HZBench編集部公開:
この記事は英語のみです。
Latency is how long a round trip takes. Jitter is how much that time changes from one round trip to the next. Real-time protocols care about both: RTP, the protocol behind much voice and video, defines interarrival jitter as the mean deviation of the difference in packet spacing at the receiver compared to the sender [1].
What a browser actually measures
A web page cannot send ICMP pings or raw UDP packets. It measures HTTP request round trips to a server instead. That time includes the network path and a little server work, so it is not directly comparable with a game's ping display. It is comparable with itself: the same test, the same server, run before and after a change.
Timer precision is not the limiting factor. performance.now() is coarsened for security, to 100 microseconds in documents that are not cross-origin isolated [2], which is far finer than network effects measured in milliseconds.
Which numbers to read
| Number | Why it matters | HZBench |
|---|---|---|
| Median | The typical round trip. Unlike the average, one slow reply does not move it. | From at least 3 replies |
| P95 | The slow end: 1 reply in 20 is slower than this. Spikes here are what you feel as lag. | From at least 20 replies |
| Jitter | How much consecutive replies differ. | Mean absolute difference between consecutive successful replies |
| Failed requests | Timeouts and errors. A browser cannot tell lost packets from other failures. | Counted separately |
Why one number misleads
Ten replies of 20 ms and one of 220 ms average about 38 ms, which describes none of them. The median stays at 20 ms and the P95 shows the slow reply. That is why HZBench leads with the median and shows the P95 and jitter next to it, and why it also measures response time while a download is running: delay that grows under load is a common cause of lag that idle measurements miss.
Comparing Wi-Fi and Ethernet fairly
- Run both tests on the same device, to the same server, a few minutes apart.
- Close downloads, streams and cloud sync on the device and, if you can, on the rest of the network.
- Repeat each test two or three times and compare medians, P95 and jitter, not single runs.
What only other tools can show
- The route to a specific game server. Each game connects to its own servers; a browser test measures the path to the test server.
- Packet loss at the network level. Failed HTTP requests are a related signal, not the same thing.
- Behaviour under upload load. HZBench loads the connection with a download only.
Tip: when comparing Wi-Fi and Ethernet, look at P95 and jitter first. Averages often look similar while the spikes differ.
出典
- [1] RFC 3550: RTP, A Transport Protocol for Real-Time Applications (section 6.4.1, interarrival jitter), IETF / RFC Editor (閲覧 )
- [2] Performance: now() method, MDN Web Docs (閲覧 )