using System;
using System.Diagnostics;
using System.Threading;
namespace CPU
{
class Program
{
static PerformanceCounter cpu = new PerformanceCounter(
"Processor", "% Processor Time", "_Total");
static PerformanceCounter memory = new PerformanceCounter(
"Memory", "% Committed Bytes in Use");
static void Main(string[] args)
{
while (true)
{
Console.WriteLine("CPU: {0:n1}%", cpu.NextValue());
Console.WriteLine("Memory: {0:n0}%", memory.NextValue());
Thread.Sleep(1000);
}
}
}
}
----------------------------------------------------------------------------------------------------------------
ShineingShare
在台灣的高速雲端
完全免費
不須註冊帳號
無限檔案空間
無下載流量限制
網站 : http://www.shineingshare.com/
留言列表