Skip to content

Instantly share code, notes, and snippets.

@atdt
Created November 30, 2012 09:16
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 atdt/4174695 to your computer and use it in GitHub Desktop.
Save atdt/4174695 to your computer and use it in GitHub Desktop.
Timing info
function getTimingInfo() {
var performance = window.performance || window.webkitPerformance;
if ( !performance || !performance.timing ) return null;
var timing = performance.timing;
return [
timing.loadEventStart - timing.navigationStart,
timing.domainLookupEnd - timing.domainLookupStart,
timing.connectEnd - timing.connectStart,
timing.responseStart - timing.requestStart,
timing.responseEnd - timing.responseStart,
timing.fetchStart - timing.navigationStart
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment