mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-01-31 19:53:11 +08:00
- Replace single-sample CPU calculation with two-sample delta method - Add 0.5 second sleep between CPU stat samples to calculate actual usage - Parse all 7 CPU time fields (user, nice, sys, idle, iowait, irq, softirq) from /proc/stat - Calculate CPU percentage as (1 - idle_diff/total_diff) * 100 - Add zero division protection when total_diff is 0 - Fix incorrect CPU usage reporting caused by using cumulative stat values