• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.arkui.performanceMonitor (Performance Monitor)
2
3The **performanceMonitor** module provides APIs for performance monitoring indicators: response delay, completion delay, and frame loss rate.
4
5> **NOTE**
6>
7> The APIs of this module are supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version.
8>
9> The APIs provided by this module are system APIs.
10
11
12## Modules to Import
13
14```ts
15import performanceMonitor from '@ohos.arkui.performanceMonitor';
16```
17
18
19## ActionType
20
21Enumerates types of actions that trigger user scenes.
22
23**System capability**: SystemCapability.ArkUI.ArkUI.Full
24
25| Name| Value| Description|
26| -- | -- | -- |
27| LAST_DOWN | 0 | Pressing against the screen. |
28| LAST_UP | 1 | Lifting a finger off the screen.|
29| FIRST_MOVE | 2 | First swiping on the screen.|
30
31
32## performanceMonitor.begin
33
34begin(scene: string, startInputType: ActionType, note?: string): void
35
36Starts a user scene.
37
38
39**System capability**: SystemCapability.ArkUI.ArkUI.Full
40
41**Parameters**
42
43| Name| Type| Mandatory| Description|
44| -- | -- | -- | -- |
45| scene | string | Yes| User scene ID.|
46| startInputType | [ActionType](#actiontype)| Yes| Type of action that triggers the user scene.|
47| note | string| No| Important information about the user scene.|
48
49**Example**
50  ```ts
51performanceMonitor.begin("LAUNCHER_APP_LAUNCH_FROM_ICON", performanceMonitor.ActionType.LAST_UP, "APP_START_BEGIN");
52  ```
53
54
55## performanceMonitor.end
56
57end(scene: string): void
58
59Ends a user scene.
60
61**System capability**: SystemCapability.ArkUI.ArkUI.Full
62
63**Parameters**
64| Name| Type| Mandatory| Description|
65| -- | -- | -- | -- |
66| scene | string | Yes| User scene ID, which corresponds to that in **begin**.|
67
68**Example**
69  ```ts
70performanceMonitor.end("LAUNCHER_APP_LAUNCH_FROM_ICON");
71  ```
72