Created
August 23, 2014 17:41
-
-
Save eriwen/b5a2b7c6a774c8bbec7d to your computer and use it in GitHub Desktop.
Site Resource Timing
This file contains hidden or 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
// Navigation Timing | |
var t = performance.timing, | |
pageloadtime = t.loadEventStart - t.navigationStart, | |
dns = t.domainLookupEnd - t.domainLookupStart, | |
tcp = t.connectEnd - t.connectStart, | |
ttfb = t.responseStart - t.navigationStart; | |
// Resource Timing | |
var r0 = performance.getEntriesByType("resource")[0], | |
loadtime = r0.duration, | |
dns = r0.domainLookupEnd - r0.domainLookupStart, | |
tcp = r0.connectEnd - r0.connectStart, | |
ttfb = r0.responseStart - r0.startTime; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment