What is the alternative to os.loadavg () for Windows

Since it os.loadavg()returns [0, 0, 0], is there a way to get the average CPU load on Windows-based systems at 1, 5 and 15 minute intervals without having to check every few seconds and save the result yourself?

+4
source share
2 answers

Scrub this topic.

Use loadavg-windows from npm to enable os.loadavg()on windows.

For first results other than 0, you must wait at least one minute from the start of the application.

+1
source

You can use windows-cpu the npm package to get similar results.

+4

All Articles