修复 cpu 占用率始终为 0 bug

This commit is contained in:
2025-09-01 20:35:36 +08:00
parent 0c361a6593
commit 8cccf23a32

View File

@@ -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);