> 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.

# profileMark()

APISummary
标记一个即时(没有持续时间) trace event。

## 语法

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

## 参数

##### `name`

trace event 的名称。

##### `option`（可选）

额外选项，如 `flowId` 和自定义参数（`arg`）。

## 示例

```typescript
// 标记一个即时 trace event
lynx.performance.profileMark('FetchStarted');

// 标记一个即时 trace event 并添加自定义参数
lynx.performance.profileMark('FetchStarted', {
  args: { status: 'initiated' },
});

// 标记一个 flow 类型的即时 trace event
const flowId = lynx.performance.profileFlowId();
lynx.performance.profileMark('ActionCheckpoint', { flowId });

// 标记一个 flow 类型的即时 trace event 并添加自定义参数
lynx.performance.profileMark('ProcessMidpoint', {
  args: { step: 'middle' },
  flowId,
});
```

## 兼容性

**Compatibility Table**

**Query:** `lynx-api.lynx.performance.profileMark()`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-api/lynx/performance.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| profileMark() | Yes (3.3) | Unknown | Yes (3.3) | Yes (3.5) | Yes (3.5) | Yes |

**`profileMark()`**

- **Web — Supported (version unknown):** Implemented since `@lynx-js/web-core@0.22.0` (lynx-family/lynx-stack#2874).

