pidusage
pidusage copied to clipboard
Ton of process open to check pidusage
API Platform version(s) affected: Windows 10
Description
Running the code in a setInterval causes a ton of process to be create and cause lag
How to reproduce
import pidusage from "pidusage";
setInterval(() => {
pidusage(process.pid, (error, stats) => {
console.log(stats.cpu);
});
}, 1000);
Just run this above code
Possible Solution
Just run one process all the time and check the usage and send the usage back, instead of creating multiple process to check usage.
Additional Context
Cannot provide, causes a lot of lag by creating a ton of processes in a matter of few seconds.