int[] methods = new[] { method1(), method2() };
This one calls directly method1()
and method2()
BEFORE your Stopwatch
!
Try
Func<int>[] methods = new Func<int>[] { method1, method2 };
t.start();
methods[1]();
Example
Func<int>[] methods = new Func<int>[] { method1, method2 };
Stopwatch sw = new Stopwatch();
for(int i = 0; i < methods.Length; i++)
{
sw.Restart(); // or sw.Reset(); sw.Start();
methods[i]();
sw.Stop();
Console.WriteLine("{0} took {1} ms", allMethods[i].Method.Name, sw.ElapsedMilliseconds);
}