Skip to content

Instantly share code, notes, and snippets.

@oroger
oroger / imports_timing.js
Last active August 29, 2015 14:26 — forked from ebidel/imports_timing.js
HTML Imports Resource Timing performance
// Know how fast your HTML Imports are
var imports = document.querySelectorAll('link[rel="import"]');
[].forEach.call(imports, function(link) {
var entries = performance.getEntriesByName(link.href);
console.info('=== HTML Imports perf ===');
entries.forEach(function(e) {
console.log(e.name, 'took', e.duration, 'ms');
});
});