Last active
January 15, 2018 07:55
-
-
Save ebidel/1041c7ac4f6802034d27 to your computer and use it in GitHub Desktop.
Revisions
-
ebidel revised this gist
Nov 29, 2015 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,21 @@ (function() { 'use strict'; // First paint perf. if (window.chrome && window.chrome.loadTimes) { const getFP = function() { let load = chrome.loadTimes(); let fp = (load.firstPaintTime - load.startLoadTime) * 1000; return Math.round(fp); }; window.onload = e => { let render = () => { let fp = getFP(); console.log(`${fp} ms`); document.title += ' - ' + fp + ' ms fp'; }; window.setTimeout(render, 100); // Wait a tick so we're guaranteed a fp time. }; } })(); -
ebidel created this gist
Nov 29, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ (function() { 'use strict'; if (chrome.loadTimes) { function getFP() { let load = chrome.loadTimes(); let fp = (load.firstPaintTime - load.startLoadTime) * 1000; return Math.round(fp); } window.onload = e => { let render = () => { let fp = getFP(); console.log(`${fp} ms`); document.title += ' - ' + fp + ' ms fp'; }; setTimeout(render, 50); // Wait a tick so we're guaranteed a fp time. }; } })();