在C#中使用特定服务的CPU使用情况
我想知道C#中特定服务的CPU使用情况。
PerformanceCounter可以正常工作:
PerformanceCounter counter = new PerformanceCounter("Process", "% Processor Time", "myprocess", true);
double result = counter.NextValue();
但不包括服务:
PerformanceCounter counter = new PerformanceCounter("Service", "% Processor Time", "myservice", true);
double result = counter.NextValue();
性能计数器的正确名称是
PerformanceCounter counter = new PerformanceCounter("Process", "% Processor Time", "ACService", true);
链接地址: http://www.djcxy.com/p/87863.html