Skip to content

Instantly share code, notes, and snippets.

@andregoncalves
Created May 10, 2018 09:23
Show Gist options
  • Save andregoncalves/30eb959c37523d65f5e62b2cdcb1f3d8 to your computer and use it in GitHub Desktop.
Save andregoncalves/30eb959c37523d65f5e62b2cdcb1f3d8 to your computer and use it in GitHub Desktop.
[Page load time] measure page load time in js #devtools #js
(function(){
const t = window.performance && performance.timing;
if (!t) {
return;
}
const loadTime = (t.loadEventEnd - t.navigationStart) / 1000;
alert(`This page loaded in ${loadTime} seconds`);
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment