2010-06-17 Geoff Norton <gnorton@novell.com>
[mono.git] / mono / tests / process-stress.cs
blob2cc6e41eb22efbe1d82b4d0817978a2acb02569b
1 using System;
2 using System.Diagnostics;
4 public class Tests
6 static int iterations = 512;
8 public static void Main(string[] args) {
9 if (args.Length > 0)
10 iterations = Int32.Parse (args [0]);
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);
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 ();
30 Console.WriteLine ();