ru_utime and ru_stime

I want to know whether ru_utime and ru_stime in the getWorkerUsage function are measured in what unit. From my Google search, it says they are measured in microseconds, whereas in some of the mediasoup examples, they have taken it as milliseconds. Which unit is correct?

Any unit can be correct if provided data is accurate.

How would I calculate the percentage usage if I am not using the correct unit? And yeah, I know there are other Node.js libraries to calculate the CPU % usage, but I want to learn the native way.

Both ru_utime and ru_stime values are given in milliseconds.

1 Like