修复 cpu 占用率始终为 0 bug
This commit is contained in:
@@ -102,7 +102,7 @@ static bool get_cpu_usage(double *usage, GError *error) {
|
|||||||
|
|
||||||
if (!inited) {
|
if (!inited) {
|
||||||
prev_cpu_stat = stat;
|
prev_cpu_stat = stat;
|
||||||
inited = false;
|
inited = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
double percent = calc_cpu_usage(stat, prev_cpu_stat);
|
double percent = calc_cpu_usage(stat, prev_cpu_stat);
|
||||||
|
|||||||
Reference in New Issue
Block a user