cpuUsageAsync

fun cpuUsageAsync(prev: CpuUsage = definedExternally): Promise<CpuUsage>(source)

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.

Since

v24.6.0