2010-06-17 Geoff Norton <gnorton@novell.com>
[mono.git] / mono / benchmark / math.cs
blob4ad824275e966da435eb0e768a4dca1f8b61130f
1 using System;
3 public class MulDiv {
5 public static double mathtest (int n) {
6 double res = 0;
8 for (int j = 0; j < 200000; j++) {
9 res += Math.Sin (j);
10 res += Math.Cos (j);
13 return res;
16 public static int Main (string[] args) {
17 int repeat = 1;
19 if (args.Length == 1)
20 repeat = Convert.ToInt32 (args [0]);
22 Console.WriteLine ("Repeat = " + repeat);
24 for (int i = 0; i < (repeat * 50); i++)
25 mathtest (1000);
27 return 0;