xref: /dragonfly/test/sysperf/call2.c (revision 86d7f5d3)
1 /*
2  * call2.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.2 2005/08/02 17:11:04 hmp Exp $
7  */
8 
9 #include "blib.h"
10 
11 #define LOOP 1000000000
12 
xnop(void)13 static void xnop(void) { }
14 
15 static void (*xnop_ptr)(void) = xnop;
16 
17 int
main(int ac,char ** av)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 	xnop_ptr();
26     stop_timing(LOOP, "loop1/user");
27     return(0);
28 }
29 
30