/* @(#)stat2.c 1.2 90/01/03 NFS Rev 2 Testsuite
* 1.3 Lachman ONC Test Suite source
* create a bunch of files and stat them repeatedly
#include <sys/fs/nfs/time.h>
struct timeval stim
, etim
;
fprintf(stderr
, "usage: %s dir files count\n", argv
[0]);
if (mkdir(argv
[1], 0777) < 0) {
for (i
=0; i
<files
; i
++) {
close(creat(name
, 0666));
for (i
=0; i
<count
; i
++) {
for (j
=0; j
<files
; j
++) {
elapsed
= (float) (etim
.tv_sec
- stim
.tv_sec
) +
(float)(etim
.tv_usec
- stim
.tv_usec
) / 1000000.0;
fprintf(stdout
, "%d calls in %f seconds (%f calls/sec)\n",
stats
, elapsed
, (float)stats
/ elapsed
);