Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Thread> threadsArray = new List<Thread>();
- // Deklaracja czasow
- for (int i = 10; i <= 10000; i *= 10)
- {
- DateTime start = DateTime.Now;
- for (int j = 0; j < 10 * i; j++)
- {
- threadsArray.Add(new Thread(DoNothing));
- threadsArray[j].Start();
- }
- DateTime stop = DateTime.Now;
- TimeSpan time = stop - start;
- Console.WriteLine("Czas uruchomienia {0} wątkow: {1} ", i, time.ToString().Substring(4) + "s");
- for (int j = 0; j < 10 * i; j++)
- {
- threadsArray.Clear();
- }
- }
- Console.ReadKey();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement