Skip to content

Instantly share code, notes, and snippets.

@ebidel
Last active March 24, 2016 19:21
Show Gist options
  • Save ebidel/5b6018b9709d0ffcf3ee to your computer and use it in GitHub Desktop.
Save ebidel/5b6018b9709d0ffcf3ee to your computer and use it in GitHub Desktop.

Revisions

  1. ebidel revised this gist Aug 31, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion imports_timing.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    // Know how fast your HTML Imports are
    // Know how fast your HTML Imports are.
    // crbug.com/505279 - doesn't show sub-import resources.
    var imports = document.querySelectorAll('link[rel="import"]');
    [].forEach.call(imports, function(link) {
    var entries = performance.getEntriesByName(link.href);
  2. 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');
    });
    });