PerformanceObserver

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 AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 52Edge ? Firefox Full support 57IE No support NoOpera Full support 39Safari Full support 11WebView Android Full support YesChrome Android Full support 52Edge Mobile ? Firefox Android Full support 57Opera Android Full support 39Safari iOS Full support 11Samsung Internet Android ?
Available in workersChrome Full support 62Edge ? Firefox ? IE No support NoOpera Full support 49Safari ? WebView Android Full support 62Chrome Android Full support 62Edge Mobile ? Firefox Android ? Opera Android Full support 49Safari iOS ? Samsung Internet Android ?
PerformanceObserver() constructorChrome Full support 52Edge ? Firefox Full support 57IE No support NoOpera Full support 39Safari Full support 11WebView Android No support NoChrome Android Full support 52Edge Mobile ? Firefox Android Full support 57Opera Android Full support 39Safari iOS Full support 11Samsung Internet Android ?
disconnectChrome Full support 52Edge ? Firefox Full support 57IE No support NoOpera Full support 39Safari Full support 11WebView Android No support NoChrome Android Full support 52Edge Mobile ? Firefox Android Full support 57Opera Android Full support 39Safari iOS Full support 11Samsung Internet Android ?
observeChrome Full support 52Edge ? Firefox Full support 57IE No support NoOpera Full support 39Safari Full support 11WebView Android No support NoChrome Android Full support 52Edge Mobile ? Firefox Android Full support 57Opera Android Full support 39Safari iOS Full support 11Samsung Internet Android ?
takeRecords
Experimental
Chrome Full support YesEdge ? Firefox Full support 60IE No support NoOpera Full support YesSafari No support NoWebView Android No support NoChrome Android Full support YesEdge Mobile ? Firefox Android Full support 60Opera Android Full support YesSafari iOS No support NoSamsung 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.

Document Tags and Contributors

Last updated by: Sheppy,