是否可以跟踪进程中每个模块的CPU利用率?在下面的代码中,可以确定myProcess.Modules中每个模块的CPU和内存消耗吗?
Process[] currentProcesses = Process.GetProcesses();
Process myProcess = currentProcesses[0];
using (PerformanceCounter pcProcess = new PerformanceCounter(
"Process",
"% Processor Time",
targetProcess.ProcessName))
using (PerformanceCounter memProcess = new PerformanceCounter(
"Process",
"Working Set - Private",
targetProcess.ProcessName))
{
pcProcess.NextValue();
}