Add some additional spaces so the ctl string does not bump the
[dragonfly.git] / test / sysperf / call3.c
1 /*
2  * call1.c
3  *
4  * Test a standard function call to a function which does nothing much.
5  *
6  * $DragonFly: src/test/sysperf/call3.c,v 1.1 2004/03/20 01:51:01 dillon Exp $
7  */
8
9 #include "blib.h"
10
11 #define LOOP 500000000
12
13 static void nop1(void) { }
14 static void nop2(void) { }
15 static void nop(void (*func)(void)) { func(); }
16
17 int
18 main(int ac, char **av)
19 {
20     int i;
21
22     printf("call nop() function through function pointer in loop\n");
23     start_timing();
24     for (i = 0; i < LOOP; ++i) {
25         nop(nop1);
26         nop(nop1);
27     }
28     stop_timing(LOOP * 2, "call3/nop1-1");
29     start_timing();
30     for (i = 0; i < LOOP; ++i) {
31         nop(nop1);
32         nop(nop2);
33     }
34     stop_timing(LOOP * 2, "call3/nop1-2");
35     start_timing();
36     for (i = 0; i < LOOP; ++i) {
37         nop(nop2);
38         nop(nop2);
39     }
40     stop_timing(LOOP * 2, "call3/nop2-2");
41     return(0);
42 }
43