Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Page performance is always an area of concern for web developers. Up until recently, the only way to measure in-page performance characteristics was through increasingly complex and clever uses of the JavaScript Date object. The Web Timing API changes that by exposing internal browser metrics through a JavaScript API, allowing developers to directly access this information and do as they please with it. Unlike other APIs in this chapter, Web Timing is actually already a W3C Recommendation, though its adoption by browsers is relatively slow.
The center of Web Timing is the window.performance object. All metrics related to the page, both those already defined and those in the future, exist on this object. The Web Timing specification starts by defining two properties of performance.