public static void RunSomeRequests() { SampleMetrics test = new SampleMetrics(); List<Thread> tasks = new List<Thread>(); for (int i = 0; i < 10; i++) { int j = i; tasks.Add(new Thread(() => test.Request(j))); } tasks.ForEach(t => t.Start()); tasks.ForEach(t => t.Join()); }
public static void RunSomeRequests() { SampleMetrics test = new SampleMetrics(); List <Thread> tasks = new List <Thread>(); for (int i = 0; i < 10; i++) { int j = i; tasks.Add(new Thread(() => test.Request(j))); } tasks.ForEach(t => t.Start()); tasks.ForEach(t => t.Join()); }