public static void Main(string[] args)
{
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
List<Thread> threads = new List<Thread>();
for (var i = 0; i < 100; i++)
{
Thread thread = new Thread(new ThreadStart(ThreadFunc));
thread.Start();
threads.Add(thread);
}
foreach (var thread in threads)
{
thread.Join();
}
stopwatch.Stop();
Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed);
System.Console.ReadLine();
}