I am trying to obtain the CPU load at run time. I am trying this fantastic answer but this code gives me the output like this:
Core: 0 Usage: 0.120000
Core: 1 Usage: 0.080000
Core: 2 Usage: 0.066667
Core: 3 Usage: 0.070000
This is more than I need. How do I get the load in a scale from 0 to 100%, independently of how many cores/CPUS the user has?
OK, I can average these numbers but suppose the average is 0.08. Does it means the load is at 8%? I am not sure about that.