Skip to content

Instantly share code, notes, and snippets.

@kmdarshan
Created May 28, 2015 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmdarshan/2ad0156c4b292673e555 to your computer and use it in GitHub Desktop.
Save kmdarshan/2ad0156c4b292673e555 to your computer and use it in GitHub Desktop.
Performance for a given page
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