2013-10-09 18 views

回答

1

子進程InstanceName s是附加#n的父名。這樣做可能會有所幫助。以下是所有Chrome進程的處理器時間總和:

(new PerformanceCounterCategory("Process")) 
.GetInstanceNames() 
.Where(a => a.StartsWith("chrome")) 
.Select(a => new PerformanceCounter("Process", "% Processor Time", a).NextValue()) 
.Sum() 
相關問題