22 #ifndef UTILIB_TIMER_HPP_
23 #define UTILIB_TIMER_HPP_
38 gettimeofday(&t_start, &t_zone);
47 gettimeofday(&t_end, &t_zone);
48 return (t_end.tv_usec -
49 t_start.tv_usec) * 1e-6 + (t_end.tv_sec - t_start.tv_sec);
56 struct timeval t_start, t_end;
60 struct timezone t_zone;
void start()
starts the timer
double stop()
stops the timer and returns the time in sec