{"id":18561,"date":"2017-02-23T15:31:37","date_gmt":"2017-02-23T20:31:37","guid":{"rendered":"https:\/\/nuxx.net\/blog\/?p=18561"},"modified":"2017-02-24T09:29:18","modified_gmt":"2017-02-24T14:29:18","slug":"easy-web-page-load-timing-comparison-via-bookmarklet","status":"publish","type":"post","link":"https:\/\/nuxx.net\/blog\/2017\/02\/23\/easy-web-page-load-timing-comparison-via-bookmarklet\/","title":{"rendered":"Easy Web Page Load Timing Comparison via Bookmarklet"},"content":{"rendered":"<p>I needed to get rough metrics of web page load times across different browsers. While the built in development tools are good for fine-grained timing, outside of pay tools (eg: <a href=\"https:\/\/www.httpwatch.com\/\">HttpWatch<\/a>) or browser-specific (<a href=\"https:\/\/chrome.google.com\/webstore\/detail\/page-load-time\/fploionmjgeclbkemipmkogoaohcdbig\">Page load time<\/a> Chrome extension) I couldn&#8217;t find anything easily available for general page load time.<\/p>\n<p>It turns out that\u00a0the time\u00a0between p<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/PerformanceTiming\/navigationStart\">erformance.timing.navigationStart<\/a> and p<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/PerformanceTiming\/loadEventEnd\">erformance.timing.loadEventEnd<\/a>\u00a0does a good job of this, as it shows the time elapsed between when the browser starts navigating to the new page and when it feels the page is done loading (the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Events\/load\">load <\/a>event handler is terminated).<\/p>\n<p>A <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bookmarklet\">bookmarklet<\/a>\u00a0containing the following can be used to do this:<\/p>\n<p><code>javascript:(function(){ var loadtime = (performance.timing.loadEventEnd - performance.timing.navigationStart) \/ 1000; alert(\"Page Load Time: \" + loadtime + \" sec\"); })();<\/code><\/p>\n<p>This link can be dragged and dropped to your Favorites \/ Bookmarks bar to easily create a bookmarklet with this content: <a href=\"javascript:(function(){ var loadtime = (performance.timing.loadEventEnd - performance.timing.navigationStart) \/ 1000; alert(&quot;Page Load Time: &quot; + loadtime + &quot; sec&quot;); })();\">Page Load Time<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I needed to get rough metrics of web page load times across different browsers. While the built in development tools are good for fine-grained timing,&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/nuxx.net\/blog\/2017\/02\/23\/easy-web-page-load-timing-comparison-via-bookmarklet\/\">Continue reading<span class=\"screen-reader-text\">Easy Web Page Load Timing Comparison via Bookmarklet<\/span><\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-18561","post","type-post","status-publish","format-standard","hentry","category-computers","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/18561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/comments?post=18561"}],"version-history":[{"count":4,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/18561\/revisions"}],"predecessor-version":[{"id":18565,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/18561\/revisions\/18565"}],"wp:attachment":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/media?parent=18561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/categories?post=18561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/tags?post=18561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}