list process threads
Published: 9. October 2011 | Updated: 26. October 2011License: Microsoft Public License (MS-PL)
Categories: Windows » Processes
Tags: C# Threading Windows
Import namespace
using System.Diagnostics;
Code
Process process = Process.GetCurrentProcess(); ProcessThreadCollection threads = process.Threads; foreach (ProcessThread thread in threads) { Console.WriteLine("Id: {0}", thread.Id); Console.WriteLine("Thread State: {0}", thread.ThreadState); Console.WriteLine("Priority Level: {0}", thread.PriorityLevel); Console.WriteLine("Start Time: {0}", thread.StartTime); Console.WriteLine("CPU time: {0}", thread.TotalProcessorTime); }
| Send us feedback about this snippet » |





