Guest User

Untitled

a guest
Dec 5th, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1.  
  2.     class Thingy {
  3.         public virtual int Add(int a, int b) {
  4.             return a + b;
  5.         }
  6.     }
  7.  
  8.     class Program {
  9.         static int Main(string[] args) {
  10.             var warmjit = new Thingy();
  11.             warmjit.Add(1, 1);
  12.             var sw = System.Diagnostics.Stopwatch.StartNew();
  13.             var res = Test();
  14.             Console.WriteLine(sw.ElapsedMilliseconds);
  15.             return res;
  16.         }
  17.  
  18.         static int Test() {
  19.             int y = 0;
  20.             var x = new Thingy();
  21.             for (int i = 0; i < 100000000; i++) {
  22.                 y = x.Add(y, i);
  23.             }
  24.             return y;
  25.         }
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment