PerformanceObserverEntryList

Baseline Widely available

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

PerformanceObserverEntryList インターフェイスは、observe() メソッドを介して明示的に監視された パフォーマンスイベント のリストです。

インスタンスメソッド

PerformanceObserverEntryList.getEntries()

明示的に観測されたすべての PerformanceEntry オブジェクトのリストを返します。

PerformanceObserverEntryList.getEntriesByType()

与えられた項目型の明示的に観測されたすべての PerformanceEntry オブジェクトのリストを返します。

PerformanceObserverEntryList.getEntriesByName()

指定された名前と項目型に基づいて、明示的に監視されているすべての PerformanceEntry オブジェクトのリストを返します。

PerformanceObserverEntryList の使用

次の例では、listPerformanceObserverEntryList オブジェクトです。getEntries() メソッドが呼ばれ、この場合 "measure" と "mark" という明示的に監視されている PerformanceEntry オブジェクトをすべて取得します。

js
function perfObserver(list, observer) {
  list.getEntries().forEach((entry) => {
    if (entry.entryType === "mark") {
      console.log(`${entry.name} の開始時刻: ${entry.startTime}`);
    }
    if (entry.entryType === "measure") {
      console.log(`${entry.name} の時間: ${entry.duration}`);
    }
  });
}
const observer = new PerformanceObserver(perfObserver);
observer.observe({ entryTypes: ["measure", "mark"] });

仕様書

Specification
Performance Timeline
# performanceobserverentrylist-interface

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
PerformanceObserverEntryList
getEntries
getEntriesByName
getEntriesByType

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
Has more compatibility info.