UMD Web Utilities Library
    Preparing search index...

    Function observeFCP

    • Create a PerformanceObserver for paint timing (FCP)

      Observes First Contentful Paint using the Performance API. Falls back gracefully in non-browser environments.

      Parameters

      Returns () => void

      Cleanup function to disconnect observer

      const cleanup = observeFCP((entry) => {
      console.log('FCP:', entry.value, 'ms');
      console.log('Rating:', entry.rating);
      });

      // Later, to stop observing:
      cleanup();