Skip to content

Instantly share code, notes, and snippets.

@kiinlam
Created July 23, 2014 07:21
Show Gist options
  • Save kiinlam/1770c1108a5dcc71a406 to your computer and use it in GitHub Desktop.
Save kiinlam/1770c1108a5dcc71a406 to your computer and use it in GitHub Desktop.
window.performance
// 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