()
| 121 | |
| 122 | return { |
| 123 | async begin() { |
| 124 | await workerReady; |
| 125 | await send(workerSessionId, 'Profiler.enable'); |
| 126 | await send(workerSessionId, 'Profiler.setSamplingInterval', { interval: 150 }); |
| 127 | await send(workerSessionId, 'Profiler.start'); |
| 128 | append(`profiler:started workerSession=${workerSessionId}`); |
| 129 | }, |
| 130 | async stop() { |
| 131 | if (!workerSessionId) return null; |
| 132 | const { profile } = await send(workerSessionId, 'Profiler.stop'); |