Day 24 of⚡️ #30DaysOfWebPerf ⚡️: Timing APIs
Sia Karamalegos
Posted on December 16, 2019
Liquid error: internal
Luckily, the User Timing API exists just for this purpose!
You set "marks" as points in time to reference, then you can measure the difference between various "marks" with a "measure" to get a duration.
This API is available for 95% of users globally today.21:06 PM - 16 Dec 2019
The Navigation and Resource Timing APIs are similar and give you detailed data on the document and its assets.
To preview the data, load a page and in the console type, for example:
performance.getEntries()
performance.getEntriesByType('resource')
youtube.com/watch?v=BAeghS…21:06 PM - 16 Dec 2019
Here are some of my favorite resources for learning both:
developers.google.com/web/fundamenta…
keycdn.com/blog/user-timi…21:06 PM - 16 Dec 2019
This article was originally published on sia.codes. Head over there if you like this post and want to read others like it, or sign up for my newsletter to be notified of new posts!
💖 💪 🙅 🚩
Sia Karamalegos
Posted on December 16, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.