cpu-percentage
Get CPU usage percentage of own process
- Uses JavaScript only and node API (process.cpuUsage).
- No native code.
- No external processes.
Note: requires node 6.1 or later.
See also cpu-gauge.
Install
npm install -S cpu-percentage
Usage
In this example we measure the CPU usage while loading a text file.
var usage = ;var fs = ; var start = ;fs;
The result is similar to
{ user: 8000, system: 4000, time: 9, percent: 133.33333333333334 }