McpuUsage
Bun

method

worker_threads.Worker.cpuUsage

prev?: CpuUsage
): Promise<CpuUsage>;

This method returns a Promise that will resolve to an object identical to process.threadCpuUsage(), or reject with an ERR_WORKER_NOT_RUNNING error if the worker is no longer running. This methods allows the statistics to be observed from outside the actual thread.