LearningRecord icon indicating copy to clipboard operation
LearningRecord copied to clipboard

首屏时间、白屏时间

Open Rashomon511 opened this issue 5 years ago • 0 comments

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

performance.timing.responseStart - performance.timing.navigationStart

首屏时间

window.onload = () => {
    new Date() - performance.timing.responseStart
}

Rashomon511 avatar Jun 22 '19 09:06 Rashomon511