PerformanceObserver.observe(Object options)

基础库 2.11.0 开始支持,低版本需做兼容处理。

微信小程序插件:不支持

功能描述

开始监听性能指标数据。

参数

Object options

设置 type 监听单个类型的指标,设置 entryTypes 监听多个类型指标。

属性 类型 默认值 必填 说明
type string 否 指标类型。不能和 entryTypes 同时使用
合法值 说明
navigation 路由
render 渲染
script 脚本
loadPackage 代码包下载
entryTypes Array.<string> 否 指标类型列表。不能和 type 同时使用。

PerformanceObserver

基础库 2.11.0 开始支持,低版本需做兼容处理。

PerformanceObserver 对象,用于监听性能相关事件

属性

Array supportedEntryTypes

获取当前支持的所有性能指标类型

方法

PerformanceObserver.observe(Object options)

开始监听

PerformanceObserver.disconnect()

停止监听