Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / process-stress.cs
1 using System;
2 using System.Diagnostics;
3
4 public class Tests
5 {
6         static int iterations = 512;
7
8         public static void Main(string[] args) {
9                 if (args.Length > 0)
10                         iterations = Int32.Parse (args [0]);
11
12                 // Spawn threads without waiting for them to exit
13                 for (int i = 0; i < iterations; i++) {
14                         Console.Write (".");
15                         //Console.WriteLine("Starting: " + i.ToString());
16                         using (var p = System.Diagnostics.Process.Start("echo -n")) {
17                                 System.Threading.Thread.Sleep(10);
18                         }
19                 }
20
21                 // Spawn threads and wait for them to exit
22                 for (int i = 0; i < iterations; i++) {
23                         Console.Write (".");
24                         //Console.WriteLine("Starting: " + i.ToString());
25                         using (var p = System.Diagnostics.Process.Start("echo -n")) {
26                                 p.WaitForExit ();
27             }
28         }
29
30                 Console.WriteLine ();
31         }
32 }