> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# deprecated InitContainerEntry

:::warning
This event has been deprecated since Lynx SDK 3.7. Related data can be obtained from [`LoadBundleEntry`](/next/api/lynx-api/performance-api/performance-entry/load-bundle-entry.md) / [`ReloadBundleEntry`](/next/api/lynx-api/performance-api/performance-entry/reload-bundle-entry.md).
:::

APISummary
The `InitContainerEntry` interface documents key moments related for the [container](/next/guide/spec.md#container) preparation work before the Lynx page is displayed. It inherits from [`PerformanceEntry`](/next/api/lynx-api/performance-api/performance-entry.md).

In the initialization process, the metrics are defined as shown in the figure below:
![key moments of container initialization](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/doc/init-container-entry.png)

:::info
The key moments provided by this entry rely on the container through [`LynxView.setExtraTiming`](/next/api/lynx-native-api/lynx-view/set-extra-timing.md) provision.
:::

## Examples

This example demonstrates how to retrieve `InitContainerEntry`。

**This is an example below: performance-api**

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

```tsx {10-22}
import * as React from "@lynx-js/react";
import { root, useMemo, useState } from "@lynx-js/react";
import type { InitContainerEntry, PerformanceEntry } from "@lynx-js/types";
import "./index.css";

export default function InitContainerEntryExample(this: any) {
  const [initContainerEntry, setInitContainerEntry] = useState<string>("");

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

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

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

root.render(<InitContainerEntryExample />);

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

```

v0.8.0



## Instance properties

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

```tsx
entryType: string;
```

Returns the entry type, which is always `init`.

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

```tsx
name: string;
```

Returns the entry name, which is always `container`.

### openTime

```tsx
openTime: number;
```

The time when the container starts loading a Lynx page。This timestamp is a floating-point Unix timestamp (in milliseconds), accurate to three decimal places. For example: 1739594612307.429.

### containerInitStart

```tsx
containerInitStart: number;
```

The time when the container initialization starts. This timestamp is a floating-point Unix timestamp (in milliseconds), accurate to three decimal places. For example: 1739594612307.429.

### containerInitEnd

```tsx
containerInitEnd: number;
```

The time when the container initialization completes. This timestamp is a floating-point Unix timestamp (in milliseconds), accurate to three decimal places. For example: 1739594612307.429.

### prepareTemplateStart

```tsx
prepareTemplateStart: number;
```

The time when the container starts preparing the [TemplateBundle](/next/guide/spec.md#app-bundle-aka-template-bundle). "Preparing" means obtaining the TemplateBundle via network download, loading local cache, or any other method. This timestamp is a floating-point Unix timestamp (in milliseconds), accurate to three decimal places. For example: 1739594612307.429.

### prepareTemplateEnd

```tsx
prepareTemplateEnd: number;
```

The time when the container finishes preparing the [TemplateBundle](/next/guide/spec.md#app-bundle-aka-template-bundle). "Preparing" means obtaining the TemplateBundle via network download, loading local cache, or any other method. This timestamp is a floating-point Unix timestamp (in milliseconds), accurate to three decimal places. For example: 1739594612307.429.

## Compatibility

**Compatibility Table**

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

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

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

