FstartCpuProfile
Bun

function

v8.startCpuProfile

function startCpuProfile(

Starting a CPU profile then return a SyncCPUProfileHandle object. This API supports using syntax.

const handle = v8.startCpuProfile({ sampleInterval: 1, maxBufferSize: 10_000 });
const profile = handle.stop();
console.log(profile);

Referenced types

interface CPUProfileOptions

  • maxBufferSize?: number

    Maximum number of samples to keep before older entries are discarded. Default: 4294967295.

  • sampleInterval?: number

    Requested sampling interval in milliseconds. Default: 0.

interface SyncCPUProfileHandle

  • Stopping collecting the profile and the profile will be discarded.

  • stop(): string;

    Stopping collecting the profile and return the profile data.