[lcp] const po = new PerformanceObserver(() => {}); po.observe({type: 'largest-contentful-paint', buffered: true}); const lastEntry = po.takeRecords().slice(-1)[0]; return lastEntry.renderTime || lastEntry.loadTime; [cls] const po = new PerformanceObserver(() => {}); po.observe({type: 'layout-shift', buffered: true}); return po.takeRecords().reduce((val, entry) => val + entry.value, 0); [fid] const po = new PerformanceObserver(() => {}); po.observe({type: 'first-input', buffered: true}); const lastEntry = po.takeRecords().slice(-1)[0]; return lastEntry.processingStart - lastEntry.startTime;