Missed the action at the 2018 Chrome Dev Summit? Catch up with our playlist on the Google Chrome Developers channel on YouTube. Watch now.

Avoids Date.now() In Its Own Scripts


If you're using Date.now() to measure time, consider using performance.now() instead. performance.now() provides a higher timestamp resolution, and always increases at a constant rate that is independent of the system clock, which can be adjusted or manually skewed.


In your report, Lighthouse lists every instance of Date.now() that it finds under URLs. Replace each of these calls with performance.now().

See performance.now() for more information on the API.

More information

Lighthouse reports every instance of Date.now() that it finds from scripts that are on the same host as the page. Scripts from other hosts are excluded, because Lighthouse assumes that you don't have control over these scripts. So, there may be other scripts using Date.now() on your page, but these won't show up in your Lighthouse report.


Was this page helpful?