(options)
| 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] |
no test coverage detected