首页 > 解决方案 > performance.now() 是否从 navigationStart 开始?

问题描述

performance.now() 的起始时间是什么时候?是navigationStart、requestStart 还是别的什么?

标签: javascriptgoogle-chromeresource-timing-api

解决方案


MDN 说

performance.timing.navigationStart + performance.now() 将大约等于 Date.now()

performance.now() = Date.now() - performance.timing.navigationStart

1970 年 1 月 1 日以后performance.now()开始导航开始毫秒!


推荐阅读