1*179efaf0SMatthew Dillon /* 2*179efaf0SMatthew Dillon * syscall1.c 3*179efaf0SMatthew Dillon * 4*179efaf0SMatthew Dillon * $DragonFly: src/test/sysperf/syscall5.c,v 1.1 2005/03/28 03:13:24 dillon Exp $ 5*179efaf0SMatthew Dillon */ 6*179efaf0SMatthew Dillon 7*179efaf0SMatthew Dillon #include "blib.h" 8*179efaf0SMatthew Dillon 9*179efaf0SMatthew Dillon int main(int ac,char ** av)10*179efaf0SMatthew Dillonmain(int ac, char **av) 11*179efaf0SMatthew Dillon { 12*179efaf0SMatthew Dillon long long count = 0; 13*179efaf0SMatthew Dillon long long max; 14*179efaf0SMatthew Dillon int j; 15*179efaf0SMatthew Dillon struct timeval tv; 16*179efaf0SMatthew Dillon 17*179efaf0SMatthew Dillon printf("timing standard gettimeofday() syscall\n"); 18*179efaf0SMatthew Dillon 19*179efaf0SMatthew Dillon start_timing(); 20*179efaf0SMatthew Dillon while (stop_timing(0, NULL) == 0) { 21*179efaf0SMatthew Dillon for (j = 0; j < 100; ++j) 22*179efaf0SMatthew Dillon gettimeofday(&tv, NULL); 23*179efaf0SMatthew Dillon count += 100; 24*179efaf0SMatthew Dillon } 25*179efaf0SMatthew Dillon max = count; 26*179efaf0SMatthew Dillon start_timing(); 27*179efaf0SMatthew Dillon for (count = 0; count < max; count += 100) { 28*179efaf0SMatthew Dillon for (j = 0; j < 100; ++j) 29*179efaf0SMatthew Dillon gettimeofday(&tv, NULL); 30*179efaf0SMatthew Dillon } 31*179efaf0SMatthew Dillon stop_timing(count, "gettimeofday()"); 32*179efaf0SMatthew Dillon return(0); 33*179efaf0SMatthew Dillon } 34