2010-06-17 Geoff Norton <gnorton@novell.com>
[mono.git] / mono / benchmark / pinvoke.cs
blob5ec3a6b6b9f4a7060ee6f1b8d917c31b6981cedc
1 using System;
2 using System.Runtime.InteropServices;
4 public class Test {
6 public static int delegate_test (int a)
8 if (a == 2)
9 return 0;
11 return 1;
14 [DllImport ("libtest", EntryPoint="mono_test_empty_pinvoke")]
15 public static extern int mono_test_empty_pinvoke (int i);
17 public static int Main (String[] args) {
18 int repeat = 1;
20 if (args.Length == 1)
21 repeat = Convert.ToInt32 (args [0]);
23 Console.WriteLine ("Repeat = " + repeat);
25 for (int i = 0; i < (repeat * 5000); i++)
26 for (int j = 0; j < 10000; j++)
27 mono_test_empty_pinvoke (5);
29 return 0;