The API defines extensions to the interface to support client-side latency measurements within applications. The extensions provide interfaces to retrieve based on specific filter criteria. The standard also includes interfaces that allow an application to define callbacks that are notified when specific performance events are added to the browser's . Performance Timeline Performance performance entry metrics performance observer performance timeline This document provides an overview of the standard's interfaces. For more details about the interfaces, see the reference pages and . Using Performance Timeline Performance extensions The Performance Timeline API extends the interface with three methods that provide different mechanisms to get a set of , depending on the specified filter criteria. The methods are: Performance performance records (metrics) getEntries() Returns all recorded or, optionally, the entries based on the specified , and/or the (such as an HTML element). performance entries name performance type initiatorType getEntriesByName() Returns the recorded based on the specified and optionally the . performance entries name performance type getEntriesByType() Returns the recorded based on the specified . performance entries performance type PerformanceEntry interface The interface encapsulates a single — that is, a single data point or metric in the . This interface has the following four properties, and these properties are extended (with additional constraints) by other interfaces (such as ): PerformanceEntry performance entry performance timeline PerformanceMark name The name of the performance entry when the metric was created. entryType The type of performance metric (for example, " "). mark startTime A representing the starting time for the performance entry. high resolution timestamp duration A representing the time value of the duration of the performance event. (Some performance have no concept of and this value is set to ' ' for such types.) This interface includes a method that returns the serialization of the object. The serialization is specific to the performance entry's . high resolution timestamp entry types duration 0 toJSON() PerformanceEntry type Performance observers Check the carefully before using this in production. This is an experimental technology Browser compatibility table The interfaces allow an application to register an for specific performance event types, and when one of those event types is recorded, the application is of the event via the observer's callback function that was specified when the observer was created. performance observer observer notified When the observer (callback) is invoked, the callback's parameters include a that contains only . That is, the list contains entries only for the event types that were specified when the observer's method was invoked. The interface has the same three getEntries*() methods as the interface. However, note there is one key difference with these methods; the versions are used to retrieve performance entries within the observer callback. performance observer entry list observed performance entries observe() performance observer entry list Performance performance observer entry list observed Besides the interface's method (which is used to register the to ), the interface also has a method that stops an observer from receiving further events. PerformanceObserver's observe() entry types observe PerformanceObserver disconnect() Performance observers were added to the Level 2 version of the standard and were not widely implemented. Implementation status A summary of the interfaces' implementation status is provided below, including a link to more detailed information. Performance interface extensions: As shown in the interface's table, most of these interfaces are broadly implemented by desktop browsers and have less support on mobile devices. Performance Browser Compatibility PerformanceEntry: As shown in the interface's table, most of these interfaces are broadly implemented by desktop browsers and have less support on mobile devices. PerformanceEntry Browser Compatibility Performance Observers : As shown in the interface's table, this interface has no shipping implementations. PerformanceObserver Browser Compatibility To test your browser's support for these interfaces, run the application. perf-api-support See Also A Primer for Web Performance Timing APIs Credits Source: https://developer.mozilla.org/en-US/docs/Web/API/Performance_Timeline Published under licence Open CC Attribution ShareAlike 3.0