Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. PerformanceObserverEntryList

PerformanceObserverEntryList

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

Note: This feature is available inWeb Workers.

ThePerformanceObserverEntryList interface is a list ofperformance events that were explicitly observed via theobserve() method.

Instance methods

PerformanceObserverEntryList.getEntries()

Returns a list of all explicitly observedPerformanceEntry objects.

PerformanceObserverEntryList.getEntriesByType()

Returns a list of all explicitly observedPerformanceEntry objects of the given entry type.

PerformanceObserverEntryList.getEntriesByName()

Returns a list of all explicitly observedPerformanceEntry objects based on the given name and entry type.

Example

Using PerformanceObserverEntryList

In the following example,list is thePerformanceObserverEntryList object. ThegetEntries() method is called to get all explicitly observedPerformanceEntry objects which are "measure" and "mark" in this case.

js
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

Specification
Performance Timeline
# performanceobserverentrylist-interface

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp