Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / benchmark / fib.cs
1 using System;
2
3 public class Fib {
4
5         public static int fib (int n) {
6                 if (n < 2)
7                         return 1;
8                 return fib(n-2)+fib(n-1);
9         }
10         public static int Main (string[] args) {
11                 int repeat = 1;
12                 
13                 if (args.Length == 1)
14                         repeat = Convert.ToInt32 (args [0]);
15                 
16                 Console.WriteLine ("Repeat = " + repeat);
17
18                 for (int i = 0; i < (repeat * 50); i++)
19                         if (fib (32) != 3524578)
20                                 return 1;
21                 
22                 return 0;
23         }
24 }
25
26