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