In my application I want to display CPU and memory usage in every time intervel of 1 second.
I'am using PerformanceCounter
to get this information, but it is not correct with CPU usage of system. Please find the the code that are used in my application. This code is written in the timer tick event.
PerformanceCounter cpuCounter;
cpuCounter = new PerformanceCounter("Processor", "% Privileged Time", "_Total");
lbl_cpu_usage.Text = Convert.ToInt32(cpuCounter.NextValue()).ToString() + "%";