What is the Navigation Timing API?
The Navigation Timing API reports each stage of a page load. Learn PerformanceNavigationTiming, key properties, an example and common mistakes.
What is the Navigation Timing API?
The Navigation Timing API is a browser interface that reports how long each stage of loading a page took: redirects, connection, request, response, DOM processing and the load event. Today you read it through a PerformanceNavigationTiming entry. The older performance.timing object is deprecated, and MDN says to avoid it in new projects.
How it works
The browser records one navigation entry for the current document, as part of the Performance Timeline and the wider Web Performance API. Read it like this:
const [nav] = performance.getEntriesByType('navigation');
All values are in milliseconds relative to the start of the navigation, so startTime is always 0. Useful properties, per MDN:
domInteractive: just before the document becomesinteractive.domContentLoadedEventStartanddomContentLoadedEventEnd: theDOMContentLoadedhandlers.domComplete,loadEventStart,loadEventEnd: the document finishing and theloadhandlers.durationequalsloadEventEndminusstartTime.type:navigate,reloadorback_forward.redirectCount: redirects since the last non-redirect navigation.
The entry also inherits the network phases from PerformanceResourceTiming, such as DNS, connection and responseStart.
Example: a quick page load breakdown
On a slow page, run the line above in the browser console. If responseStart is large, the wait is on the network or the server: look at time to first byte (TTFB) and the Server-Timing header. If responseStart is small but domContentLoadedEventEnd is late, the browser is busy parsing or running scripts, so look at your JavaScript.
Common mistakes
- Using the deprecated
performance.timingin new code. - Reading
loadEventEndtoo early. It stays 0 until the load handlers finish, so read it after theloadevent. - Expecting single-page app route changes to appear. There is one navigation entry per document, not one per route.
- Averaging values and calling it performance. Look at percentiles across many visits.
- Treating a single lab run as truth for all users.
Navigation Timing in testing and monitoring
Navigation Timing is the raw material for real user monitoring: a small script reads the entry and sends it to your backend, so you see what real visitors experienced. For a controlled view, a lab tool is the counterpart: LoadFocus page speed monitoring runs scheduled Lighthouse audits from 25 cloud regions and alerts you when a page slows down, and the free Core Web Vitals checker shows real-user data for a URL. See also our guide to monitoring Core Web Vitals with alerts and reports. For the specification details, read PerformanceNavigationTiming on MDN.
FAQ
Is performance.timing deprecated?
Yes. MDN marks it as deprecated and superseded by PerformanceNavigationTiming. Use performance.getEntriesByType('navigation') instead.
How do I get the page load time?
Read the navigation entry after the load event. Its duration is loadEventEnd minus startTime, which is 0.
Does Navigation Timing measure Core Web Vitals?
No. It gives navigation milestones such as DOMContentLoaded and load. Metrics like LCP and CLS come from other performance entries.
Does it work in all browsers?
PerformanceNavigationTiming is marked widely available on MDN and has worked across browsers since October 2021.
Related terms
- What is the Performance Timeline API?
- Real User Monitoring (RUM): Definition and Examples
- What is Scheduled Maintenance?
- What is the Server-Timing API?
- What is Synthetic Monitoring? Definition, Types, RUM Comparison
- What is the Web Performance API?
- What is a Status Page? Definition and Uses
- What is API Monitoring? Definition, Metrics and Benefits
Related LoadFocus Tools
Put this concept into practice with LoadFocus, the same platform that powers everything you just read about.