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