Skip to content

Instantly share code, notes, and snippets.

@inorganik
Forked from ebidel/firstpaint.js
Last active May 23, 2017 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inorganik/55eccb8e3d482b9d2c141c6c39cd3d01 to your computer and use it in GitHub Desktop.
Save inorganik/55eccb8e3d482b9d2c141c6c39cd3d01 to your computer and use it in GitHub Desktop.
Helper to print first paint time in Chrome
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