iwm: Fix S:N reporting in ifconfig(8)
[dragonfly.git] / test / sysperf / syscall4.c
1 /*
2  * syscall1.c
3  *
4  * $DragonFly: src/test/sysperf/syscall4.c,v 1.1 2003/11/19 00:59:19 dillon Exp $
5  */
6
7 #include "blib.h"
8
9 int
10 main(int ac, char **av)
11 {
12     const char *path;
13     long long count = 0;
14     long long max;
15     struct stat st;
16     int j;
17
18     printf("timing standard stat() syscall\n");
19     if (ac > 1)
20         path = av[1];
21     else
22         path = ".";
23
24     start_timing();
25     while (stop_timing(0, NULL) == 0) {
26         for (j = 0; j < 100; ++j)
27             stat(path, &st);
28         count += 100;
29     }
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);
35     }
36     stop_timing(count, "stat()");
37     return(0);
38 }
39