头文件#include
struct timeval start, end;
gettimeofday(&start, NULL);
gettimeofday(&end, NULL);
long long total_time = (end.tv_sec - start.tv_sec) * 1000000 + (end.tv_usec - start.tv_usec);
// get the run time by microsecond
printf("total time is %lld usn", total_time);
// get the run time by millisecond
total_time /= 1000;
printf("total time is %lld msn", total_time)



