Created
May 10, 2018 09:23
-
-
Save andregoncalves/30eb959c37523d65f5e62b2cdcb1f3d8 to your computer and use it in GitHub Desktop.
[Page load time] measure page load time in js #devtools #js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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