Created
November 30, 2012 09:16
-
-
Save atdt/4174695 to your computer and use it in GitHub Desktop.
Timing info
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
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