Created
March 4, 2015 12:50
-
-
Save prasann/464cc052df99246bbf94 to your computer and use it in GitHub Desktop.
Page load time in 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
$(document).ready(function () { | |
if (typeof(console) !== 'undefined' && console.log) { | |
var now = new Date().getTime(); | |
var page_load_time = now - performance.timing.navigationStart; | |
console.log("Page loading time: " + page_load_time + ' ms'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment