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.
PerformanceObserver()
PerformanceObserver
object.PerformanceObserver.observe()
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()
performance entries
.PerformanceObserver.takeRecords()
performance entries
stored in the performance observer, emptying it out.function perf_observer(list, observer) { // Process the "measure" event } var observer2 = new PerformanceObserver(perf_observer); observer2.observe({entryTypes: ["measure"]});
Specification | Status | Comment |
---|---|---|
Performance Timeline Level 2 The definition of 'PerformanceObserver' in that specification. | Candidate Recommendation | Initial definition of PerformanceObserver interface. |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 52 | ? | 57 | No | 39 | 11 |
Available in workers | 62 | ? | ? | No | 49 | ? |
PerformanceObserver() constructor |
52 | ? | 57 | No | 39 | 11 |
disconnect |
52 | ? | 57 | No | 39 | 11 |
observe |
52 | ? | 57 | No | 39 | 11 |
takeRecords
|
Yes | ? | 60 | No | Yes | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | 52 | ? | 57 | 39 | 11 | ? |
Available in workers | 62 | 62 | ? | ? | 49 | ? | ? |
PerformanceObserver() constructor |
No | 52 | ? | 57 | 39 | 11 | ? |
disconnect |
No | 52 | ? | 57 | 39 | 11 | ? |
observe |
No | 52 | ? | 57 | 39 | 11 | ? |
takeRecords
|
No | Yes | ? | 60 | Yes | No | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver