查看页面首屏时间、白屏时间


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);  //首屏时间
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM