  </pre>
        <p>Another common real-world scenario is profiling JS across a pageload. This example profiles the onload event, sending performance timing data along with the trace.</p>
        <pre class="example" title="Profiling a page load.">
        const profiler = new Profiler({ sampleInterval: 10, maxBufferSize: 10000 });

        window.addEventListener('load', async () => {
          const trace = await profiler.stop();
          const traceJson = JSON.stringify({
            timing: performance