Performance API
WorkerGlobalScope 接口的 performance 属性返回一个 Performance 对象,该对象可用于收集有关在 worker 的作用域内运行的代码的性能信息。
性能条目是特定于上下文的。如果在 worker 线程上创建一个标记,那么你无法在主线程或任何其他 worker 中看到它。
注意,只有以下性能接口在 worker 上下文中可用:
- Performance
- PerformanceEntry
- PerformanceMark
- PerformanceMeasure
- PerformanceObserver
- PerformanceObserverEntryList
- PerformanceResourceTiming
- PerformanceServerTiming
值
一个 Performance 对象,用于获取其被调用的上下文的性能以及与计时相关信息。
规范
浏览器兼容性
参见
- Window.performance
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
