Missed the action at this year's Chrome Dev Summit? Catch up with our playlist on YouTube. Watch now.

Avoids Date.now() In Its Own Scripts

Why the audit is important

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.

How to pass the audit

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.

How the audit is implemented

This section explains how this audit is implemented, so that you can understand how the audit's score is calculated.

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.