This article needs a technical review. How you can help.
This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
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 interface is exposed to Window and Worker.
Methods
PerformanceObserver.observe()- Specifies the set of
entry typesto observe. The performance observer's callback function will be invoked when aperformance entryis recorded for one of the specifiedentryTypes PerformanceObserver.disconnect()- Stops the performance observer callback from receiving
performance entries.
Constructor
PerformanceObserver()- Creates a
PerformanceObserverobject.
Example
See the interface's constructor and method references for examples.
Specifications
| Specification | Status | Comment |
|---|---|---|
| Performance Timeline Time Level 2 The definition of 'PerformanceObserver' in that specification. |
Editor's Draft | Initial definition of PerformanceObserver interface. |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
PerformanceObserver |
No support | No support | No support | No support | No support |
| Feature | Android | Firefox Mobile (Gecko) | Firefox OS | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
PerformanceObserver |
No support | No support | No support | No support | No support | No support |