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/lynx/lynx-performance/create-observer.md.
Lynx
  • 简体中文
  • createObserver()

    创建一个 PerformanceObserver 对象,该对象将用于接收 Lynx engine 产生的性能事件。

    语法

    createObserver(callback: PerformanceCallback): PerformanceObserver;

    参数

    callback:

    处理性能事件的回调函数,类型定义为 type PerformanceCallback = (entry: PerformanceEntry) => void。entry 是 PerformanceEntry 的子类型。

    PerformanceObserver 接收到性能事件时该回调被触发。

    返回值

    一个 PerformanceObserver 对象。

    示例

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

    兼容性

    LCD tables only load in the browser

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