PerformanceObserverEntryList

PerformanceObserverEntryList interface is a list of peformance events that were explicitly observed via the observe() 方法。

Note: this interface is exposed to Window and Worker .

方法

PerformanceObserverEntryList.getEntries()
Returns a list of explicitly observed PerformanceEntry objects based on the given filter .
PerformanceObserverEntryList.getEntriesByType()
Returns a list of explicitly observed PerformanceEntry objects of the given entry type .
PerformanceObserverEntryList.getEntriesByName()
Returns a list of explicitly observed PerformanceEntry objects based on the given name and entry type .

范例

// Create observer for all performance event types
// list is of type PerformanceObserveEntryList
var observe_all = new PerformanceObserver(function(list, obs) {
   var perfEntries = list.getEntries();
   for (var i = 0; i < perfEntries.length; i++) {
      print_perf_entry(perfEntries[i]);
      // do something with it
   }
})
					

规范

规范 状态 Comment
Performance Timeline Level 2
The definition of 'PerformanceObserverEntryList' in that specification.
候选推荐 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
PerformanceObserverEntryList Chrome 52 Edge ≤79 Firefox 57 IE No Opera 39 Safari 11 WebView Android No Chrome Android 52 Firefox Android 57 Opera Android 41 Safari iOS 11 Samsung Internet Android 6.0
getEntries Chrome 52 Edge ≤79 Firefox 57 IE No Opera 39 Safari No WebView Android No Chrome Android 52 Firefox Android 57 Opera Android 41 Safari iOS No Samsung Internet Android 6.0
getEntriesByName Chrome 52 Edge ≤79 Firefox 57 IE No Opera 39 Safari No WebView Android No Chrome Android 52 Firefox Android 57 Opera Android 41 Safari iOS No Samsung Internet Android 6.0
getEntriesByType Chrome 52 Edge ≤79 Firefox 57 IE No Opera 39 Safari No WebView Android No Chrome Android 52 Firefox Android 57 Opera Android 41 Safari iOS No Samsung Internet Android 6.0

图例

完整支持
完整支持
不支持
不支持