CPU usage function

Hi, is there a way to know the CPU usage in an Electron? Just like the Free memory function but for the CPU.


There is not. The main reason is that it’s not a multi-process system like Windows or Unix, so there’s not as much of a scenario where stuff in the background is using up CPU. You can keep track of how much CPU you use by measuring the time when you enter and exit loop() but it’s hard to determine exactly how much CPU is used outside your code in multi-threaded mode.