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/profile-start.md.
Lynx
  • 简体中文
  • profileStart()

    标记一个 trace event 的开始。

    语法

    profileStart(name: string, option?: { flowId: number, arg?:  Record<string, string>}): void;

    参数

    name

    trace event 的名称。

    option(可选)

    额外选项,例如 flowId 和自定义参数(arg)。

    示例

    // 开始一个 trace event。
    lynx.performance.profileStart('DataFetch');
    
    // 开始一个 trace event 并添加自定义参数
    lynx.performance.profileStart('DataFetch', {
      args: { url: 'https://api.example.com/data', method: 'GET' },
    });
    
    // 开始一个 flow 类型的 trace event
    const flowId = lynx.performance.profileFlowId();
    lynx.performance.profileStart('UserAction', { flowId });
    
    // 开始一个 flow 类型的 trace event 并添加自定义参数
    lynx.performance.profileStart('ComplexProcess', {
      args: { step: 'start' },
      flowId,
    });

    兼容性

    LCD tables only load in the browser

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