Firefox Tomorrow

web api interface

PerformanceObserverEntryList

View on MDN ↗

Available in workers

The PerformanceObserverEntryList interface is a list of performance events that were explicitly observed via the observe() method.

Instance methods

Example

Using PerformanceObserverEntryList

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

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.