小编jas*_*ur2的帖子

PerformanceCounter报告的CPU使用率高于观察到的CPU使用率

我现在正在这样做:

PerformanceCounter cpuUsage = new PerformanceCounter("Processor", "% Processor Time", "_Total");
cpuUsage.NextValue();
System.Threading.Thread.Sleep(1000);
RV = cpuUsage.NextValue();
Run Code Online (Sandbox Code Playgroud)

我定期调用该函数以获得CPU使用率.当我在TaskManager中监视系统时,PerformanceCounter报告的CPU使用率始终比TaskManager报告的高出15-20%(TaskManager中的30%=来自PerformanceCounter的50%).

也许有我忽略的文档,但有没有人有解释?也许它检查的瞬间CPU使用率更高,任务管理器报告平均值?

c# performancecounter cpu-usage

3
推荐指数
1
解决办法
2076
查看次数

标签 统计

c# ×1

cpu-usage ×1

performancecounter ×1