-
-
Save inorganik/55eccb8e3d482b9d2c141c6c39cd3d01 to your computer and use it in GitHub Desktop.
Helper to print first paint time in Chrome
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 characters
if (window.chrome && window.chrome.loadTimes) { | |
let load = chrome.loadTimes(); | |
const getFP = function() { | |
let fp = (load.firstPaintTime - load.startLoadTime) * 1000; | |
return Math.round(fp); | |
}; | |
let fp = getFP(); | |
console.log(`first paint: ${fp} ms`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment