ProcessThread.ThreadState : ProcessThread « System.Diagnostics « C# / C Sharp by API






ProcessThread.ThreadState

 


using System;
using System.Diagnostics;

class MainClass
{
   public static void Main()
   {
      Process thisProc = Process.GetCurrentProcess();
      ProcessThreadCollection myThreads = thisProc.Threads;

      foreach(ProcessThread pt in myThreads)
      {
         Console.WriteLine("thread:  {0}", pt.Id);
         Console.WriteLine("    started: {0}", pt.StartTime);
         Console.WriteLine("    CPU time: {0}", pt.TotalProcessorTime);
         Console.WriteLine("    priority: {0}", pt.BasePriority);
         Console.WriteLine("    thread state: {0}", pt.ThreadState); 
      }
   }
}

   
  








Related examples in the same category

1.ProcessThread.BasePriority
2.ProcessThread.StartTime
3.ProcessThread.TotalProcessorTime