CPU使用率 武胜

public class MyClass {
  PerformanceCounter counter = null;

  public float CpuUsage {
    get {
      if (counter == null) {
        counter = new PerformanceCounter ("Processor", "% Processor Time", "_Total");
      }
      return (counter.NextValue ());
    }
  }
}

原文地址:https://www.cnblogs.com/zeroone/p/2439183.html