Merge from vendor branch NTPD:
[dragonfly.git] / test / sysperf / call2.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/call2.c,v 1.1 2004/03/20 01:51:01 dillon Exp $
7  */
8
9 #include "blib.h"
10
11 #define LOOP 1000000000
12
13 static void nop(void) { }
14
15 static void (*nop_ptr)(void) = nop;
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_ptr();
26     stop_timing(LOOP, "loop1/user");
27     return(0);
28 }
29