Created
May 28, 2015 00:03
-
-
Save kmdarshan/2ad0156c4b292673e555 to your computer and use it in GitHub Desktop.
Performance for a given page
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
The following script calculates how much time to load a page since the most recent navigation. | |
<html> | |
<head> | |
<script type="text/javascript"> | |
function onLoad() { | |
var now = new Date().getTime(); | |
var page_load_time = now - performance.timing.navigationStart; | |
alert("User-perceived page loading time: " + page_load_time); | |
} | |
</script> | |
</head> | |
<body onload="onLoad()"> | |
<!- Main page body goes from here. --> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment