VB.Net – Get thread count in current process

Problem

Need to count how many threads are open by your application process

Solution

Imports System.Diagnostics
Module ModuleThreads

Sub MainThread()
   Console.WriteLine(“Thread Count: {0}”, Process.GetCurrentProcess().Threads.Count)
End Sub

End Module

 

Hits: 4348

Leave a Reply