Baseline Widely available
Note: This feature is available in Web Workers.
The PerformanceObserverEntryList
interface is a list of performance events that were explicitly observed via the observe()
method.
PerformanceObserverEntryList.getEntries()
Returns a list of all explicitly observed PerformanceEntry
objects.
PerformanceObserverEntryList.getEntriesByType()
Returns a list of all explicitly observed PerformanceEntry
objects of the given entry type.
PerformanceObserverEntryList.getEntriesByName()
Returns a list of all explicitly observed PerformanceEntry
objects based on the given name and entry type.
In the following example, list
is the PerformanceObserverEntryList
object. The getEntries()
method is called to get all explicitly observed PerformanceEntry
objects which are "measure" and "mark" in this case.
function perfObserver(list, observer) {
list.getEntries().forEach((entry) => {
if (entry.entryType === "mark") {
console.log(`${entry.name}'s startTime: ${entry.startTime}`);
}
if (entry.entryType === "measure") {
console.log(`${entry.name}'s duration: ${entry.duration}`);
}
});
}
const observer = new PerformanceObserver(perfObserver);
observer.observe({ entryTypes: ["measure", "mark"] });
Specifications Browser compatibility
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4