For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/lynx-api/performance-api/performance-observer.md.
Lynx
  • 简体中文
  • PerformanceObserver BTS

    PerformanceObserver 用于观察性能事件,并在 Lynx Engine 产生性能事件 (PerformanceEntry) 时收到通知。 它必须通过 lynx.performance.createObserver() 创建,并在创建时绑定一个回调函数用于处理接收到的性能事件。

    实例方法

    PerformanceObserver.observe()

    指定要观察的性能事件类型集合并开始观察。

    PerformanceObserver.disconnect()

    停止接收性能事件。

    示例

    创建一个 PerformanceObserver

    该示例展示了如何创建一个 PerformanceObserver 并监听 metric.fcp 和 pipeline 事件。

    兼容性

    LCD tables only load in the browser

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。