using System;
using System
using System
public class CpuLoadInfo
{
// auxiliary print methods
private static void Say ( string txt )
{
Console
}
// auxiliary print methods
private static void Say()
{
Say(
}
// The main method
[STAThread]
public static void Main()
{
Say(
Say();
Say(
Say(
Say(
Say(
PerformanceCounter pc
= new PerformanceCounter(CategoryName
Say(
Say(
Say();
Say(
Say();
Say(
while (true)
{
Thread
float cpuLoad = pc
Say(
}
}
// constants used to select the performance counter
private const string CategoryName =
private const string CounterName =
private const string InstanceName =
}
這是在我計算機上的計算結果
Entering measurement loop
CPU load =
CPU load =
CPU load =
CPU load =
CPU load =
CPU load =
CPU load =
CPU load =
From:http://tw.wingwit.com/Article/program/net/201311/13786.html