struct timeval tv , tv2 ;
unsigned long start_utime , end_utime;
float time_period;
...
...
...
gettimeofday(&tv,NULL);
start_utime = tv.tv_sec * 1000000 + tv.tv_usec;
....
....
....
gettimeofday(&tv2,NULL);
end_utime = tv2.tv_sec * 1000000 + tv2.tv_usec;
time_period = ((float)(end_utime - start_utime)) /1000000;
沒有留言:
張貼留言