Created
August 26, 2014 07:11
-
-
Save puterjam/3b9c040363a27e8179cd to your computer and use it in GitHub Desktop.
performance 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
<!doctype html> | |
<html> | |
<head> | |
</head> | |
<body onload="init()"> | |
<script> | |
function init() | |
{ | |
var navigationTiming = performance.getEntriesByType("navigation")[0]; | |
if (window.console) console.log("Name: " + navigationTiming.name + "\n" + | |
"Entry Type: " + navigationTiming.entryType + "\n" + | |
"Start Time: " + navigationTiming.startTime + "\n" + | |
"Duration: " + navigationTiming.duration + "\n" + | |
"Unload: " + (navigationTiming.unloadEventEnd - navigationTiming.unloadEventStart) + "\n" + | |
"Redirect: " + (navigationTiming.redirectEnd - navigationTiming.redirectStart) + "\n" + | |
"App Cache: " + (navigationTiming.domainLookupStart - navigationTiming.fetchStart) + "\n" + | |
"DNS: " + (navigationTiming.domainLookupEnd - navigationTiming.domainLookupStart) + "\n" + | |
"TCP: " + (navigationTiming.connectEnd - navigationTiming.connectStart) + "\n" + | |
"Request: " + (navigationTiming.responseStart - navigationTiming.requestStart) + "\n" + | |
"Response: " + (navigationTiming.responseEnd - navigationTiming.responseStart) + "\n" + | |
"Processing: " + (navigationTiming.loadEventStart - navigationTiming.responseEnd) + "\n" + | |
"Onload: " + (navigationTiming.loadEventEnd - navigationTiming.loadEventStart) + "\n"); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment