According to mdn navigationStart, we can use PerformanceNavigationTiming interface instead. But I can't find a way to get any thing equal to performance.timing.navigationStart performance.now()
, which is approximately equal to Date.now().
Some says performance.timeOrigin, but my test shows that performance.timeOrigin is not equal to performance.timing.navigationStart.
In chrome
performance.timeOrigin - performance.timing.navigationStart = -951855.3999023438
CodePudding user response:
You are facing a bug in Chrome 106. performance.timeOrigin
is indeed what you want and it should indeed be close to performance.timing.navigationStart
. There is even a WPT (that Chrome 106 fails).
This bug has already been reported and should be fixed in the next versions of Chrome, we just have to wait for it.