[System] Tweak socket test
[mono-project.git] / mono / tests / bench1.cs
blobd820878e13666a8e5987fdbcade08bbdc16b5f3c
1 using System;
3 public class Benchmark {
5 public static int Run ()
7 int count = 32;
8 int[] fibs = new int [count + 1];
9 int index;
10 int index2;
11 int temp;
13 fibs[0] = 1;
14 fibs[1] = 1;
15 for(index = 2; index <= count; ++index)
17 fibs[index] = fibs[index - 2] + fibs [index - 1];
20 for(index = 0; index <= count; ++index)
22 for(index2 = 1; index2 <= count; ++index2)
24 if(fibs[index2 - 1] < fibs[index2])
26 int ti = index2 - 1;
27 temp = fibs[ti];
28 fibs[ti] = fibs[index2];
29 fibs[index2] = temp;
34 return fibs [0];
37 public static int Main () {
38 for (int i = 0; i < 1000000; i++)
39 if (Run () != 3524578)
40 return 1;
42 return 0;