For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/lynx-api/lynx/lynx-performance/create-observer.md.
Lynx
  • English
  • createObserver()

    Creates a PerformanceObserver object that will be used to receive performance events generated by Lynx engine.

    Syntax

    createObserver(callback: PerformanceCallback): PerformanceObserver;

    Parameters

    callback

    A callback function that handles performance events, defined as type PerformanceCallback = (entry: PerformanceEntry) => void. The entry is a subclass of PerformanceEntry.

    This callback is triggered when the PerformanceObserver receives a performance event.

    Return Value

    A PerformanceObserver object.

    Examples

    The following example creates a PerformanceObserver watching for metric.fcp and pipeline entries.

    Compatibility

    LCD tables only load in the browser

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.