11 public class Test : ITest
13 public void DoNothing<T>()
22 static void Main(string[] args)
24 const int iterations = 10000;
26 Test test = new Test ();
28 DateTime start = DateTime.Now;
29 Console.Write ("Calling Test.DoNothing<Program>() on an object reference... ");
30 for (int i = 0; i < iterations; ++i)
32 test.DoNothing<Program> ();
34 DateTime end = DateTime.Now;
35 TimeSpan duration = end - start;
36 Console.WriteLine ("Took " + duration.TotalMilliseconds + " ms.");
38 ITest testInterface = test;
41 Console.Write ("Calling Test.DoNothing<Program>() on an interface reference... ");
42 for (int i = 0; i < iterations; ++i)
44 testInterface.DoNothing<Program> ();
47 duration = end - start;
48 Console.WriteLine ("Took " + duration.TotalMilliseconds + " ms.");