Example:
auto percent = cpuPercent(1.seconds);
writeln("CPU usage: ", percent, "%");Gets CPU usage percentage.
interval | Duration to wait between measurements. If 0, returns instantaneous value. |
perCpu | If true, returns percentage per CPU core. If false, returns total percentage. |
Example:
auto percent = cpuPercent(1.seconds);
writeln("CPU usage: ", percent, "%");