9 static struct timeval tp1,tp2;
11 static void start_timer()
13 gettimeofday(&tp1,NULL);
16 static double end_timer()
18 gettimeofday(&tp2,NULL);
19 return (tp2.tv_sec + (tp2.tv_usec*1.0e-6)) -
20 (tp1.tv_sec + (tp1.tv_usec*1.0e-6));
24 static void create_loop(const char *fname)
34 fd = open(fname, O_RDWR|O_CREAT|O_TRUNC|O_EXCL, 0644);
41 if (end_timer() > 1.0) {
42 printf("%.0f ops/sec\r", count/end_timer());
50 static void usage(void)
52 printf("usage: create_loop <file>\n");
55 int main(int argc, char *argv[])