System.Diagnostics.Stopwatch s = new System.Diagnostics.Stopwatch(); s.Start(); for (i = 0; i < count; i++) Test1(); s.Stop(); Console.WriteLine("Test1: {0}", s.ElapsedMilliseconds); s.Start(); for (i = 0; i < count; i++) Test2(); s.Stop(); Console.WriteLine("Test2: {0}", s.ElapsedMilliseconds);
System.Diagnostics.Stopwatch s = new System.Diagnostics.Stopwatch(); s.Start(); for (i = 0; i < count; i++) Test1(); s.Stop(); Console.WriteLine("Test1: {0}", s.ElapsedMilliseconds); s.Reset(); s.Start(); for (i = 0; i < count; i++) Test2(); s.Stop(); Console.WriteLine("Test2: {0}", s.ElapsedMilliseconds);