Merge pull request #1861 from saper/home-override
[mono-project.git] / mcs / tests / gtest-116.cs
blob5397915181ac445bd4b2abce9ff08ea5c3eb6974
1 using System;
3 namespace Slow
5 public interface ITest
7 void DoNothing<T>()
8 where T : class;
11 public class Test : ITest
13 public void DoNothing<T>()
14 where T : class
16 T x = null;
20 class Program
22 public 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;
40 start = DateTime.Now;
41 Console.Write ("Calling Test.DoNothing<Program>() on an interface reference... ");
42 for (int i = 0; i < iterations; ++i)
44 testInterface.DoNothing<Program> ();
46 end = DateTime.Now;
47 duration = end - start;
48 Console.WriteLine ("Took " + duration.TotalMilliseconds + " ms.");