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

# deprecated InitLynxviewEntry

:::warning
该事件在 Lynx SDK 3.7 版本已废弃，相关数据可从 [`LoadBundleEntry`](/next/zh/api/lynx-api/performance-api/performance-entry/load-bundle-entry.md) / [`ReloadBundleEntry`](/next/zh/api/lynx-api/performance-api/performance-entry/reload-bundle-entry.md) 中获取.
:::

APISummary
`InitLynxviewEntry` 接口提供有关 [LynxView](/next/zh/guide/spec.md#lynxview) 初始化的关键时间，它继承自 [`PerformanceEntry`](/next/zh/api/lynx-api/performance-api/performance-entry.md)。

在初始化流程中，指标的定义如下图：
![lynxview 初始化的关键时间](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/doc/init-lynxview-entry.png)

## 示例

该示例展示了如何获取 `InitLynxviewEntry`。

**下面是一个示例: performance-api**

**Entry:** `src/init-lynx-view-entry`
**Bundle:** `dist/init-lynx-view-entry.lynx.bundle`

```tsx {10-21}
import { root, useMemo, useState } from "@lynx-js/react";
import type { InitLynxviewEntry, PerformanceEntry } from "@lynx-js/types";
import "./index.css";

export default function InitLynxviewEntryExample(this: any) {
  const [initLynxviewEntry, setInitLynxviewEntry] = useState<string>("");

  function observerPerformanceEntry() {
    "background-only";
    // 1. Create a performance observer.
    const observer = lynx.performance.createObserver((entry: PerformanceEntry) => {
      if (entry.entryType == "init" && entry.name == "lynxview") {
        // 3. Received "init.lynxview" event.
        const initLynxviewEntry = entry as InitLynxviewEntry;
        setInitLynxviewEntry(JSON.stringify(initLynxviewEntry, null, 4));
        observer.disconnect();
      }
    });
    // 2. register to listen to the "init.lynxview" event.
    observer.observe(["init.lynxview"]);
  }

  useMemo(() => {
    observerPerformanceEntry();
  }, []);

  return (
    <view className="container">
      <text className="title">Hello InitLynxviewEntry~</text>
      <text className="entry">{initLynxviewEntry}</text>
    </view>
  );
}

root.render(<InitLynxviewEntryExample />);

if (import.meta.webpackHot) {
  import.meta.webpackHot.accept();
}

```

v0.8.0



## 实例属性

### [entryType](/next/zh/api/lynx-api/performance-api/performance-entry.md#entrytype)

```tsx
entryType: string;
```

性能事件的类型，当前类所有实例的值均固定为 `init`。

### [name](/next/zh/api/lynx-api/performance-api/performance-entry.md#name)

```tsx
name: string;
```

性能事件的名称，当前类所有实例的值均固定为 `lynxview`。

### createLynxStart

```tsx
createLynxStart: number;
```

LynxView 开始创建的时间。该时间戳是一个表示为浮点型的 Unix 时间戳（单位：毫秒），精确到小数点后三位。例如：1739594612307.429。

### createLynxEnd

```tsx
createLynxEnd: number;
```

LynxView 创建完毕的时间。该时间戳是一个表示为浮点型的 Unix 时间戳（单位：毫秒），精确到小数点后三位。例如：1739594612307.429。

## 兼容性

**Compatibility Table**

**Query:** `lynx-api.performance-api.performance-entry.init-lynxview-entry`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| init-lynxview-entry | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |

