Javascript Methods from Performance Timeline API | Hacker Noon

Author profile picture

@mozillaMozilla Contributors

Mozilla (stylized as moz://a) is a free software community founded in 1998 by members of Netscape.

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.

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

performance records (metrics)

, depending on the specified filter criteria. The methods are:

PerformanceEntry interface



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



The name of the performance entry when the metric was created.

The type of performance metric (for example, ”



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 ‘


‘ for such types.)

This interface includes a


method that returns the serialization of the


object. The serialization is specific to the performance entry’s



Performance observers

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.

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.

To test your browser’s support for these interfaces, run the



See Also


Author profile picture

Read my stories

Mozilla (stylized as moz://a) is a free software community founded in 1998 by members of Netscape.



The Noonification banner

Subscribe to get your daily round-up of top tech stories!

read original article here