I want to know the CPU usage of a specific service in C #.
PerformanceCounter works great with the process:
PerformanceCounter counter = new PerformanceCounter("Process", "% Processor Time", "myprocess", true); double result = counter.NextValue();
but not with services:
PerformanceCounter counter = new PerformanceCounter("Service", "% Processor Time", "myservice", true); double result = counter.NextValue();
userfloflo
source share