Created
July 23, 2014 07:21
-
-
Save kiinlam/1770c1108a5dcc71a406 to your computer and use it in GitHub Desktop.
window.performance
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
// window.performance | |
function resourceTiming() | |
{ | |
var resourceList = window.performance.getEntriesByType("resource"); | |
for (i = 0; i < resourceList.length; i++) | |
{ | |
if (resourceList[i].initiatorType == "img") | |
{ | |
alert("End to end resource fetch: "+ (resourceList[i].responseEnd - resourceList[i].startTime)); | |
} | |
} | |
} | |
resourceTiming(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment