Skip to content

Instantly share code, notes, and snippets.

@shapeshifta78
Created November 10, 2011 08:57
Show Gist options
  • Save shapeshifta78/1354460 to your computer and use it in GitHub Desktop.
Save shapeshifta78/1354460 to your computer and use it in GitHub Desktop.
Web Timings Api Test
$(window).load(function(){
(function (win){
var performance =
win.performance ||
win.webkitPerformance ||
win.mozPerformance ||
win.msPerformance ||
{},
timings = performance.timing || {},
testLoad = function(){
if(timings.loadEventEnd > 0){
log( 'Ladezeit in Ms: ' + (timings.loadEventEnd - timings.navigationStart) );
win.clearTimeout(timer);
}else{
var timer = win.setTimeout(testLoad, 1000);
}
};
//test if loadEventEnd
testLoad();
})(window);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment