2010-06-17 Geoff Norton <gnorton@novell.com>
[mono.git] / mono / benchmark / max-min.cs
bloba2f946bc02de1320e8f005f9142bd063da851251
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 */
7 class T {
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);
19 return x;
22 static void Main () {
23 for (int i = 0; i < 50; i++)
24 DoIt (1, 5);