![]()
Day 24 of⚡️ #30DaysOfWebPerf ⚡️
Sometimes the alphabet soup of perf metrics aren't enough. Do you ever wish you could measure the time required for a specific action?
[gif alt: cat with big, longing eyes and text saying "I want."]21:06 PM - 16 Dec 2019
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
Discussion