MCPcopy Index your code
hub / github.com/nodejs/node / startCpuProfile

Method startCpuProfile

lib/internal/worker.js:598–617  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

596 }
597
598 startCpuProfile(options) {
599 normalizeCpuProfileOptions ??=
600 require('internal/v8/cpu_profiler').normalizeCpuProfileOptions;
601 const {
602 samplingIntervalMicros,
603 maxSamples,
604 } = normalizeCpuProfileOptions(options);
605 const startTaker = this[kHandle]?.startCpuProfile(
606 samplingIntervalMicros,
607 maxSamples);
608 return new Promise((resolve, reject) => {
609 if (!startTaker) return reject(new ERR_WORKER_NOT_RUNNING());
610 startTaker.ondone = (err, id) => {
611 if (err) {
612 return reject(err);
613 }
614 resolve(new CPUProfileHandle(this, id));
615 };
616 });
617 }
618
619 /**
620 * @param {object} [options]

Callers 2

Calls 4

requireFunction · 0.50
rejectFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected