Find out how many threads my application is running?

c#, multithreading

Solution

You may take a look at the Threads property of the current process:

System.Diagnostics.Process.GetCurrentProcess().Threads

Of course this includes unmanaged threads as well.

Problem

I'm trying to find out how many threads my application is running in order to make a live graph of the performance. Can you point me in the right direction or provide a code example? Thanks!

Original source