Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / benchmark / max-min.cs
1 /*
2 mono max-min.exe              0m1.468s
3 mono -O=inline max-min.exe    0m1.087s
4 ../mini/mono max-min.exe      0m0.511s
5 */
6
7 class T {
8
9         static int DoIt (int a, int b) {
10                 int x = 0;
11                 for (int j = 0; j < 200000; j++) {
12                         x += System.Math.Max (a, b);
13                         x += System.Math.Max (a, b);
14                         x += System.Math.Max (j, b);
15                         x += System.Math.Max (j, b);
16                         x += System.Math.Min (System.Math.Max (j, x), b);
17                         x += System.Math.Min (System.Math.Max (j, x), b);
18                 }
19                 return x;
20         }
21         
22         static void Main () {
23                 for (int i = 0; i < 50; i++)
24                         DoIt (1, 5);
25         }
26 }