LearningRecord
LearningRecord copied to clipboard
首屏时间、白屏时间
Performance 接口可以获取到当前页面中与性能相关的信息。 该类型的对象可以通过调用只读属性 Window.performance 来获得。 白屏时间:
performance.timing.responseStart - performance.timing.navigationStart
首屏时间
window.onload = () => {
new Date() - performance.timing.responseStart
}