Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save speedsticko/787d42bc9503c6a202e5ab8ab6c079d7 to your computer and use it in GitHub Desktop.
Save speedsticko/787d42bc9503c6a202e5ab8ab6c079d7 to your computer and use it in GitHub Desktop.
This page loaded in ${loadTime} seconds
(function(){
const t = window.performance && performance.timing;
if (!t) {
return;
}
const loadTime = (t.loadEventEnd - t.navigationStart) / 1000;
alert(`This page loaded in ${loadTime} seconds`);
}())
src: http://www.phpied.com/this-page-loaded-in-x-seconds/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment