[RESOLVED] displaying cpu usage
hi. I'm trying to display the cpu usage ofmycomputer. I'm not a coding genius and i'm sure its just a simple mistake. Here's the code the I have:
PerformanceCounter CpuCounter;
CpuCounter = new PerformanceCounter();
CpuCounter.CategoryName = "Processor";
CpuCounter.CounterName = "% Processor Time";
CpuCounter.InstanceName = "_Total";
txtCPU.Text = CpuCounter.NextValue().ToString();
Just that its displaying the value 0 every time I run it. Also I tried using the RawValue method but the value being displayed is just too large. Could somebody help me pleaseeeeeee
Jennifer