process.threadCpuUsage([previousValue])


process.threadCpuUsage() 方法返回当前工作线程的用户和系统 CPU 时间使用情况,结果是一个包含 usersystem 属性的对象,其值为微秒(百万分之一秒)。

【The process.threadCpuUsage() method returns the user and system CPU time usage of the current worker thread, in an object with properties user and system, whose values are microsecond values (millionth of a second).】

之前对 process.threadCpuUsage() 的调用结果可以作为参数传递给该函数,以获取差异读数。

【The result of a previous call to process.threadCpuUsage() can be passed as the argument to the function, to get a diff reading.】