PerformanceObserver

You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!

The PerformanceObserver interface is used to observe performance measurement events and be notified of new performance entries as they are recorded in the browser's performance timeline.

Note: This feature is available in Web Workers.

Constructor

PerformanceObserver()
Creates and returns a new PerformanceObserver object.

Methods

PerformanceObserver.observe()
Specifies the set of entry types to observe. The performance observer's callback function will be invoked when a performance entry is recorded for one of the specified entryTypes
PerformanceObserver.disconnect()
Stops the performance observer callback from receiving performance entries.
PerformanceObserver.takeRecords()
Returns the current list of performance entries stored in the performance observer, emptying it out.

Example

function perf_observer(list, observer) { 
   // Process the "measure" event 
} 
var observer2 = new PerformanceObserver(perf_observer); 
observer2.observe({entryTypes: ["measure"]});

Specifications

Specification Status Comment
Performance Timeline Level 2
The definition of 'PerformanceObserver' in that specification.
Candidate Recommendation Initial definition of PerformanceObserver interface.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
PerformanceObserverChrome Full support 52Edge ? Firefox Full support 57IE No support NoOpera Full support 39Safari Full support 11WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 57Opera Android Full support 41Safari iOS Full support 11Samsung Internet Android ?
PerformanceObserver() constructorChrome Full support 52Edge ? Firefox Full support 57IE No support NoOpera Full support 39Safari Full support 11WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 57Opera Android Full support 41Safari iOS Full support 11Samsung Internet Android ?
disconnectChrome Full support 52Edge ? Firefox Full support 57IE No support NoOpera Full support 39Safari Full support 11WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 57Opera Android Full support 41Safari iOS Full support 11Samsung Internet Android ?
observeChrome Full support 52Edge ? Firefox Full support 57IE No support NoOpera Full support 39Safari Full support 11WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 57Opera Android Full support 41Safari iOS Full support 11Samsung Internet Android ?
supportedEntryTypes
Experimental
Chrome Full support 73Edge ? Firefox ? IE No support NoOpera Full support YesSafari ? WebView Android Full support 73Chrome Android Full support 73Firefox Android ? Opera Android Full support YesSafari iOS ? Samsung Internet Android ?
takeRecords
Experimental
Chrome Full support 65Edge ? Firefox Full support 60IE No support NoOpera Full support YesSafari No support NoWebView Android Full support 65Chrome Android Full support 65Firefox Android Full support 60Opera Android Full support YesSafari iOS No support NoSamsung Internet Android ?
Available in workersChrome Full support 62Edge ? Firefox ? IE No support NoOpera Full support 49Safari ? WebView Android Full support 62Chrome Android Full support 62Firefox Android ? Opera Android Full support 46Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

See also