CPU使用率

public class MyClass {
  PerformanceCounter counter = null;

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

posted on 2012-04-09 16:47  武胜-阿伟  阅读(192)  评论(0编辑  收藏  举报