Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / benchmark / muldiv.cs
1 using System;
2
3 public class MulDiv {
4
5         public static int muldiv (int n) {
6                 int res = n;
7
8                 for (int j = 0; j < 1048; j++) {
9                         for (int i = 0; i < (n * 4); i++) {
10                                 n = (n / 256);
11                                 n++;
12                                 n = n * 128;
13                         }
14                 }
15                 
16                 return res;
17         }
18         
19         public static int Main (string[] args) {
20                 int repeat = 1;
21                 
22                 if (args.Length == 1)
23                         repeat = Convert.ToInt32 (args [0]);
24                 
25                 Console.WriteLine ("Repeat = " + repeat);
26
27                 for (int i = 0; i < (repeat * 50); i++)
28                         muldiv (1000);
29                 
30                 return 0;
31         }
32 }
33
34