Skip to content

Instantly share code, notes, and snippets.

@geraldotech
Created August 27, 2022 21:47
Show Gist options
  • Save geraldotech/1d012d99b88ac5e9eb2202e3eff2355a to your computer and use it in GitHub Desktop.
Save geraldotech/1d012d99b88ac5e9eb2202e3eff2355a to your computer and use it in GitHub Desktop.
LoadTime
var loadTime = function(){
setTimeout(function(){
var perfData = window.performance.timing;
var EstimatedTime = (perfData.loadEventEnd - perfData.navigationStart);
console.clear();
console.log(EstimatedTime);
console.log(EstimatedTime+" milliseconds");
console.log("Start: "+perfData.navigationStart);
console.log("End: "+perfData.loadEventEnd);
console.log(JSON.stringify(perfData));
},10);
};
loadTime();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment