From b475414d0db663ede58121abeaba0a09f8469a26 Mon Sep 17 00:00:00 2001 From: Admin Date: Thu, 27 Jul 2023 02:03:45 +0000 Subject: [PATCH] =?UTF-8?q?=E6=80=A7=E8=83=BD=E9=9B=B7=E8=BE=BE=E6=96=B0?= =?UTF-8?q?=E5=A2=9E@ohos.arkui.performanceMonitor.d.ts=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Admin --- .../apis/js-apis-arkui-performancemonitor.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 zh-cn/application-dev/reference/apis/js-apis-arkui-performancemonitor.md diff --git a/zh-cn/application-dev/reference/apis/js-apis-arkui-performancemonitor.md b/zh-cn/application-dev/reference/apis/js-apis-arkui-performancemonitor.md new file mode 100644 index 0000000000..495ee323a5 --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-arkui-performancemonitor.md @@ -0,0 +1,71 @@ +# @ohos.arkui.performanceMonitor (性能监测) + +用户操作场景提供性能相关指标监测能力,目前仅包含响应时延、完成时延、丢帧。 + +> **说明:** +> +> 从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 +> +> 本模块接口为系统接口。 + + +## 导入模块 + +```ts +import performanceMonitor from '@ohos.arkui.performanceMonitor' +``` + + +## ActionType + +用户场景触发模式枚举。 + + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +| 名称 | 值 | 说明 | +| -- | -- | -- | +| LAST_DOWN | 0 | 用户按压事件触发。 | +| LAST_UP | 1 | 用户离手事件触发。 | +| FIRST_MOVE | 2 | 用户首次滑动事件触发。 | + + +## performanceMonitor.begin + +begin(scene: string, startInputType: ActionType, note?: string): void + +用户场景开始。 + + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** +| 参数名 | 类型 | 必填 | 说明 | +| -- | -- | -- | -- | +| scene | string | 是 | 用户场景id | +| startInputType | [ActionType](#actiontype)| 是 | 用户场景触发模式 | +| note | string| 否 | 用户场景重要信息 | + +**示例:** + ```ts +performanceMonitor.begin("LAUNCHER_APP_LAUNCH_FROM_ICON", performanceMonitor.ActionType.LAST_UP, "APP_START_BEGIN"); + ``` + + +## performanceMonitor.end + +end(scene: string): void; + +用户场景结束 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** +| 参数名 | 类型 | 必填 | 说明 | +| -- | -- | -- | -- | +| scene | string | 是 | 用户场景id,与begin配对 | + +**示例:** + ```ts +performanceMonitor.end("LAUNCHER_APP_LAUNCH_FROM_ICON"); + ``` \ No newline at end of file -- GitLab