Skip to content

Instantly share code, notes, and snippets.

@boldfacedesign
Forked from ebidel/imports_timing.js
Last active August 29, 2015 14:26
Show Gist options
  • Save boldfacedesign/78973964d3fbb76b8c81 to your computer and use it in GitHub Desktop.
Save boldfacedesign/78973964d3fbb76b8c81 to your computer and use it in GitHub Desktop.

Revisions

  1. @ebidel ebidel created this gist Jul 29, 2015.
    9 changes: 9 additions & 0 deletions imports_timing.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    // 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');
    });
    });