Skip to content

Instantly share code, notes, and snippets.

@macbre
Created October 21, 2014 20:40
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save macbre/bcf74b0d68fb6a59f68c to your computer and use it in GitHub Desktop.
Save macbre/bcf74b0d68fb6a59f68c to your computer and use it in GitHub Desktop.
Chrome's first paint timing
// first paint in chrome from https://github.com/addyosmani/timing.js
var hasFirstPaint = 0;
if (window.chrome && window.chrome.loadTimes) {
var paint = window.chrome.loadTimes().firstPaintTime * 1000;
var firstPaint = paint - (window.chrome.loadTimes().startLoadTime*1000);
var firstPaintLeft = (firstPaint / loaded)*100;
hasFirstPaint = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment