Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (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.
- };
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement