Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / benchmark / pinvoke.cs
1 using System;
2 using System.Runtime.InteropServices;
3
4 public class Test {
5
6         public static int delegate_test (int a)
7         {
8                 if (a == 2)
9                         return 0;
10
11                 return 1;
12         }
13         
14         [DllImport ("libtest", EntryPoint="mono_test_empty_pinvoke")]
15         public static extern int mono_test_empty_pinvoke (int i);
16
17         public static int Main (String[] args) {
18                 int repeat = 1;
19                                 
20                 if (args.Length == 1)
21                         repeat = Convert.ToInt32 (args [0]);
22                 
23                 Console.WriteLine ("Repeat = " + repeat);
24
25                 for (int i = 0; i < (repeat * 5000); i++)
26                         for (int j = 0; j < 10000; j++)
27                                 mono_test_empty_pinvoke (5);
28                 
29                 return 0;
30         }
31 }