xref: /dragonfly/test/sysperf/syscall2.c (revision 36a3d1d6)
1 /*
2  * syscall2.c
3  *
4  * $DragonFly: src/test/sysperf/syscall2.c,v 1.2 2004/10/31 20:19:24 eirikn Exp $
5  */
6 
7 #include <time.h>
8 
9 #include "blib.h"
10 
11 extern int getuid_test(void);
12 
13 int
14 main(void)
15 {
16 	struct timespec ts, ts2;
17 	int error;
18 	long long count = 0;
19 	long long max;
20 	int j;
21 
22 	start_timing();
23 	while (stop_timing(0, NULL) == 0) {
24 		for (j = 0; j < 100; ++j)
25 			getuid_msg();
26 		count += 100;
27 	}
28 	max = count;
29 	start_timing();
30 	for (count = 0; count < max; count += 100) {
31 		for (j = 0; j < 100; ++j)
32 			getuid_msg();
33 	}
34 	stop_timing(count, "getuid() sysmsg");
35 }
36