PerformanceCounter cpuload = new PerformanceCounter();
cpuload.CategoryName = "Processor";
cpuload.CounterName = "% Processor Time";
cpuload.InstanceName = "_Total";
Console.WriteLine(cpuload.NextValue() + "%");
輸出總是0%,而cpuload.RawValue
就像736861484375左右,NextValue()
發生了什麼?爲什麼CPU性能計數器不斷報告0%的CPU使用率?