dhcpcd: update README.DRAGONFLY
[dragonfly.git] / test / sysperf / syscall4.c
blob935d630f23d114854ef560d81f682e64f6c203f6
1 /*
2 * syscall1.c
4 * $DragonFly: src/test/sysperf/syscall4.c,v 1.1 2003/11/19 00:59:19 dillon Exp $
5 */
7 #include "blib.h"
9 int
10 main(int ac, char **av)
12 const char *path;
13 long long count = 0;
14 long long max;
15 struct stat st;
16 int j;
18 printf("timing standard stat() syscall\n");
19 if (ac > 1)
20 path = av[1];
21 else
22 path = ".";
24 start_timing();
25 while (stop_timing(0, NULL) == 0) {
26 for (j = 0; j < 100; ++j)
27 stat(path, &st);
28 count += 100;
30 max = count;
31 start_timing();
32 for (count = 0; count < max; count += 100) {
33 for (j = 0; j < 100; ++j)
34 stat(path, &st);
36 stop_timing(count, "stat()");
37 return(0);