5 static struct timeval tp1,tp2;
7 static void start_timer()
9 gettimeofday(&tp1,NULL);
12 static double end_timer()
14 gettimeofday(&tp2,NULL);
15 return (tp2.tv_sec + (tp2.tv_usec*1.0e-6)) -
16 (tp1.tv_sec + (tp1.tv_usec*1.0e-6));
19 int main(int argc, char *argv[])
28 printf("%f milliseconds\n", end_timer() * 1000);