2
我想計算每個線程的處理時間。 我該怎麼做。? 想我的100個線程都在執行同樣的方法工作()同時,那麼如果我把下面的代碼幫我把我所追求每個線程的處理時間?
Process thisProc = Process.GetCurrentProcess();
string procName = thisProc.ProcessName;
DateTime started = thisProc.StartTime;
int memory = thisProc.VirtualMemorySize;
int priMemory = thisProc.PrivateMemorySize;
int physMemory = thisProc.WorkingSet;
ProcessPriorityClass priClass = thisProc.PriorityClass;
TimeSpan cpuTime = thisProc.TotalProcessorTime;
Console.WriteLine(" started: {0}", started.ToString());
Console.WriteLine(" CPU time: {0}", cpuTime.ToString());
Console.WriteLine(" Virtual Memory: {0}", memory + " ; Private Memory: " + priMemory + " ; Physical Memory: " + physMemory);
好的。 非常感謝 – phen 2010-07-02 12:22:26