Get current FCP value if available
Retrieves the First Contentful Paint value from the Performance API. Returns null if FCP hasn't occurred yet or API is unavailable.
FCP in milliseconds or null if not available
const fcp = getFCP();if (fcp !== null) { console.log('FCP:', fcp, 'ms');} Copy
const fcp = getFCP();if (fcp !== null) { console.log('FCP:', fcp, 'ms');}
Get current FCP value if available
Retrieves the First Contentful Paint value from the Performance API. Returns null if FCP hasn't occurred yet or API is unavailable.