I was just admiring Tim Kadlec eye-pleasing site. Nice, simple, see what I'm talkin' 'bout.
The feature I liked most was the footer that said "This page loaded in 0.186 seconds". First of all - fast! Second - I thought all sites should have that. And what better way than an on-demand bookmarklet you carry yourself in your daily browsing?
So any time you say to yourself "wow, that was painfully slow" or "weee, my hat flew off!", you can answer the simple question of how long it actually took. Cause perceptions lie.
Anyway, here's the simple code lifted and modified from Tim's:
(function(){ const t = window.performance && performance.timing; if (!t) { return; } const loadTime = (t.loadEventEnd - t.navigationStart) / 1000; alert(`This page loaded in ${loadTime} seconds`); }())
And here's the bookmarklet form - click to try and then just drag to your bookmarks.
Enjoy and let's make the web faster!
Comments? Find me on BlueSky, Mastodon, LinkedIn, Threads, Twitter