diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 26d10be6778335..a6bb81173793ca 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -1613,6 +1613,19 @@ added: v10.5.0 The `'online'` event is emitted when the worker thread has started executing JavaScript code. +### `worker.cpuUsage([prev])` + + + +* Returns: {Promise} + +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. + ### `worker.getHeapSnapshot([options])`