【发布时间】:2011-04-04 10:35:34
【问题描述】:
我尝试在我的程序中计算 CPU 使用率除以核心。现在我使用 PerformanceCounter 并在 0 和 1 之间更改 InstanceName 我有来自 2 个核心的数据。
PerformanceCounter pc0 = new PerformanceCounter("Processor", "% Processor Time", "0");
PerformanceCounter pc1 = new PerformanceCounter("Processor", "% Processor Time", "1");
如何获得第三、第四核心等的核心使用情况?
有人可以帮助我吗?
谢谢
【问题讨论】:
-
你试过
new PerformanceCounter("Processor", "% Processor Time", "2");吗?
标签: c# cpu-usage performancecounter