Navigation Timing API
The part of the Performance API that records a timestamp for each step of loading the current page, from DNS lookup to the document being ready.
In more detail
Reading performance.getEntriesByType('navigation') returns an object with fields such as domainLookupStart, connectStart, connectEnd, requestStart and responseStart. Subtracting pairs gives the time spent on DNS, TCP and TLS, and responseStart minus requestStart approximates the wait for the first byte. domInteractive marks when the HTML parser finished.
Example
const [nav] = performance.getEntriesByType('navigation'); nav.responseStart - nav.requestStartRelated terms
- Performance API — The browser interface for high-precision timing, which lets page code read measurements such as navigation phases, resource loads and custom marks.
- time to first byte — The time from starting a request until the first byte of the server's response arrives, covering connection setup, server work and travel time.
- navigation — Loading a new page in a tab, from typing an address or clicking a link to receiving and showing the new document.
Taught in
- How Browsers Work: Navigation, DNS, TCP, TLS And Request Timing — Frontend Architecture & Web Platform