跳到主要内容

Performance

✅️️ Methods

🔨Performance.disable

禁用收集和报告指标。

EN
Disable collecting and reporting metrics.

🔨Performance.enable

启用收集和报告指标功能。

EN
Enable collecting and reporting metrics.
参数必填标记类型描述原文
timeDomainstring用于收集和报告持续时间指标的时域。
允许值:timeTicksthreadTicks
ENTime domain to use for collecting and reporting duration metrics.
Allowed Values: timeTicks, threadTicks

🔨Performance.getMetrics

获取运行时指标的当前值。

EN
Retrieve current values of run-time metrics.
返回对象类型描述原文
metricsarray[Metric]当前运行时指标的值。
ENCurrent values for run-time metrics.

🔨Performance.setTimeDomain🧪❌️

设置用于收集和报告持续时间指标的时间域。请注意,此操作必须在启用指标收集之前调用。在指标收集已启用时调用此方法将返回错误。

EN
Sets time domain to use for collecting and reporting duration metrics. Note that this must be called before enabling metrics collection. Calling this method while metrics collection is enabled returns an error.
参数必填标记类型描述原文
timeDomain✔️string时域
允许取值:timeTicks, threadTicks
ENTime domain
Allowed Values: timeTicks, threadTicks

✅️️ Events

👋Performance.metrics

指标的当前值。

EN
Current values of the metrics.
参数必填标记类型描述原文
metrics✔️array[Metric]指标当前值。
ENCurrent values of the metrics.
title✔️string时间戳标题。
ENTimestamp title.

✅️️ Types

📌Performance.Metric

运行时执行指标。

EN
Run-time execution metric.

返回类型:object

属性必填标记类型描述原文
name✔️string指标名称。
ENMetric name.
value✔️number指标值。
ENMetric value.