using System.Threading; var curThread = Thread.CurrentThread.ManagedThreadId; Console.WriteLine($"The current thread is: {curThread}");