Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Thingy {
- public virtual int Add(int a, int b) {
- return a + b;
- }
- }
- class Program {
- static int Main(string[] args) {
- var warmjit = new Thingy();
- warmjit.Add(1, 1);
- var sw = System.Diagnostics.Stopwatch.StartNew();
- var res = Test();
- Console.WriteLine(sw.ElapsedMilliseconds);
- return res;
- }
- static int Test() {
- int y = 0;
- var x = new Thingy();
- for (int i = 0; i < 100000000; i++) {
- y = x.Add(y, i);
- }
- return y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment