|
1 | 1 | ---
|
2 | 2 | id: global-performance
|
3 |
| -title: performance |
| 3 | +title: performance 🧪 |
4 | 4 | ---
|
5 | 5 |
|
6 |
| -:::warning |
7 |
| -🚧 This page is work in progress, so please refer to the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/performance) for more information. |
| 6 | +import ExperimentalAPIWarning from './\_experimental-api-warning.mdx'; |
| 7 | + |
| 8 | +<ExperimentalAPIWarning /> |
| 9 | + |
| 10 | +The global [`performance`](https://developer.mozilla.org/en-US/docs/Web/API/Window/performance) object, as defined in Web specifications. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +# Reference |
| 15 | + |
| 16 | +## Instance properties |
| 17 | + |
| 18 | +### `eventCounts` |
| 19 | + |
| 20 | +See [documentation in MDN]((https://developer.mozilla.org/en-US/docs/Web/API/Performance/eventCounts)). |
| 21 | + |
| 22 | +### `memory` |
| 23 | + |
| 24 | +See [documentation in MDN]((https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory)). |
| 25 | + |
| 26 | +### `rnStartupTiming` ⚠️ |
| 27 | + |
| 28 | +:::warning Non-standard |
| 29 | +This is a React Native specific extension. |
| 30 | +::: |
| 31 | + |
| 32 | +Provides information about the startup time of the application. |
| 33 | + |
| 34 | +```ts |
| 35 | +get rnStartupTiming(): ReactNativeStartupTiming; |
| 36 | +``` |
| 37 | + |
| 38 | +The `ReactNativeStartupTiming` interface provides the following fields: |
| 39 | + |
| 40 | +| Name | Type | Description | |
| 41 | +| --- | --- | --- | |
| 42 | +| `startTime` | number \| void | When the application startup was started. | |
| 43 | +| `initializeRuntimeStart` | number \| void | When the React Native runtime initialization was started. | |
| 44 | +| `executeJavaScriptBundleEntryPointStart` | number \| void | When the execution of the application bundle was started. | |
| 45 | +| `endTime` | number \| void | When the React Native runtime was fully initialized. | |
| 46 | + |
| 47 | +### `timeOrigin` |
| 48 | + |
| 49 | +:::info Partial support |
| 50 | +Provides the number of milliseconds from the Unix epoch until system boot, instead of the number of milliseconds from the Unix epoch until app startup. |
| 51 | +::: |
| 52 | + |
| 53 | +See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin). |
| 54 | + |
| 55 | +## Instance methods |
| 56 | + |
| 57 | +### `clearMarks()` |
| 58 | + |
| 59 | +See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMarks). |
| 60 | + |
| 61 | +### `clearMeasures()` |
| 62 | + |
| 63 | +See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMeasures). |
| 64 | + |
| 65 | +### `getEntries()` |
| 66 | + |
| 67 | +See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntries). |
| 68 | + |
| 69 | +### `getEntriesByName()` |
| 70 | + |
| 71 | +See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByName). |
| 72 | + |
| 73 | +### `getEntriesByType()` |
| 74 | + |
| 75 | +See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByType). |
| 76 | + |
| 77 | +### `mark()` |
| 78 | + |
| 79 | +See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark). |
| 80 | + |
| 81 | +### `measure()` |
| 82 | + |
| 83 | +See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure). |
| 84 | + |
| 85 | +### `now()` |
| 86 | + |
| 87 | +:::info Partial support |
| 88 | +Provides the number of milliseconds from system boot, instead of the number of milliseconds from app startup. |
8 | 89 | :::
|
9 | 90 |
|
10 |
| -The global `performance` object, as defined in Web specifications. |
| 91 | +See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now). |
0 commit comments