Can’t make the #ChromeDevSummit this year? Catch all the content (and more!) on the livestream, or join your peers for a CDS Extended event at a hosted location nearby. To learn more, check out the Chrome Dev Summit 2019 website.

Avoids console.time() In Its Own Scripts

Overview

If you're using console.time() to measure your page's performance, consider using the User Timing API instead. Benefits include:

  • High-resolution timestamps.
  • Exportable timing data.
  • Integration with the Chrome DevTools Timeline. When the User Timing function performance.measure() is called during a Timeline recording, DevTools automatically adds the measurement to the Timeline's results, as shown in the my custom measurement label in the screenshot below.

User Timing measurement in Chrome DevTools Timeline

Recommendations

In your report, Lighthouse lists every instance of console.time() that it finds under URLs. Replace each of these calls with performance.mark(). If you want to measure the time that has elapsed between two marks, use performance.measure().

See User Timing API: Understanding Your Web App to learn how to use the API.

More information

Lighthouse reports every instance of console.time() 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 console.time() on your page, but these won't show up in your Lighthouse report.

Feedback

Was this page helpful?
Yes
What was the best thing about this page?
It helped me complete my goal(s)
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It had the information I needed
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It had accurate information
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It was easy to read
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
Something else
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
No
What was the worst thing about this page?
It didn't help me complete my goal(s)
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It was missing information I needed
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It had inaccurate information
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It was hard to read
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
Something else
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.