Created
June 15, 2012 22:26
-
-
Save hustKiwi/2938995 to your computer and use it in GitHub Desktop.
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 getPerfStats() { | |
var timing = window.performance.timing; | |
return { | |
dns: timing.domainLookupEnd - timing.domainLookupStart, | |
connect: timing.connectEnd - timing.connectStart, | |
ttfb: timing.responseStart - timing.connectEnd, | |
basePage: timing.responseEnd - timing.responseStart, | |
frontEnd: timing.loadEventStart - timing.responseEnd | |
}; | |
} | |
window.onload = function() { | |
var stats = getPerfStats(); | |
console.log('stats', stats); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment