sigar/bindings/dotnet/examples/CpuInfo.cs

22 lines
592 B
C#
Raw Normal View History

2004-06-22 06:37:04 +08:00
using System;
using Hyperic.Sigar;
public class CpuInfo {
public static void Main() {
Sigar sigar = new Sigar();
Hyperic.Sigar.CpuInfo[] infos =
sigar.CpuInfoList();
2004-06-22 06:37:04 +08:00
System.Console.WriteLine(infos.Length + " total CPUs..");
foreach (Hyperic.Sigar.CpuInfo info in infos) {
System.Console.WriteLine("Vendor........" + info.Vendor);
System.Console.WriteLine("Model........." + info.Model);
System.Console.WriteLine("Mhz..........." + info.Mhz);
System.Console.WriteLine("");
}
}
}