抖音开放平台Logo
开发者文档
“/”唤起搜索
控制台
  • JS API 列表
  • 基础
  • tt.canIUse
  • tt.canIPutStuffOverComponent
  • tt.base64ToArrayBuffer
  • tt.arrayBufferToBase64
  • tt.setPageInfo
  • 性能
  • tt.performance.createObserver
  • tt.performance.getEntries
  • tt.performance.getEntriesByName
  • tt.performance.getCurrentPageEntries
  • tt.performance.setBufferSize
  • PerformanceEntry
  • tt.performance.clearMarks
  • tt.performance.mark
  • tt.performance.getEntriesByPage
  • tt.performance.getEntriesByType
  • 线程
  • 窗口尺寸变化
  • 生命周期
  • 版本更新
  • 定时器
  • 应用级事件
  • 环境变量
  • TTML
  • 网络
  • 媒体
  • 地图
  • 文件
  • 数据缓存
  • 地理位置
  • 设备
  • 画布
  • 界面
  • 页面导航
  • 开放接口
  • 行业开放
  • 第三方平台
  • 其它
  • 生活服务(即将废弃)
  • 小程序智能体
  • tt.performance.getEntries
    收藏
    我的收藏

    基础库 1.60.0 开始支持本方法,低版本需做兼容处理。这是一个同步方法。
    该方法返回当前缓冲区中的所有性能数据。

    语法

    tt.performance.getEntries()

    参数说明

    返回值

    Array, PerformanceEntry 集合。

    代码示例

    const entries = tt.performance && tt.performance.getEntries(); for (let i = 0, len = entries.length; i < len; i++) { console.log("entry name: " + entries[i].name); console.log("entry entryType: " + entries[i].entryType); console.log("entry startTime: " + entries[i].startTime); console.log("entry duration: " + entries[i].duration); }

    Bug & Tip