worker.getHeapStatistics()


此方法返回一个 Promise,它将解析为与 v8.getHeapStatistics() 相同的对象;如果工作线程停止运行,则返回 ERR_WORKER_NOT_RUNNING 错误并拒绝。此方法允许从实际线程外部观察统计信息。

¥This method returns a Promise that will resolve to an object identical to v8.getHeapStatistics(), 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.