Performance 接口可以获取到当前页面中与性能相关的信息。
该类型的对象可以通过调用只读属性 Window.performance 来获得。
白屏时间:

var a = performance.timing.responseStart - performance.timing.navigationStart
console.log(a);  //白屏时间

首屏时间

window.onload = () => {
  var b = new Date() - performance.timing.responseStart
  console.log(b);  //首屏时间
}

相关文章:

  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-02-12
  • 2021-10-03
  • 2021-06-03
  • 2021-07-04
猜你喜欢
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案