21 struct timespec system_time_;
22 clock_gettime(CLOCK_REALTIME, &system_time_);
24 timer->
clock_start_value =
static_cast<double>(system_time_.tv_sec) + static_cast<double>(system_time_.tv_nsec) * 1.e-9;
29 struct timespec system_time_;
30 clock_gettime(CLOCK_REALTIME, &system_time_);
32 timer->
clock_end_value =
static_cast<double>(system_time_.tv_sec) + static_cast<double>(system_time_.tv_nsec) * 1.e-9;
double clock_start_value
time stamp when timer_start() gets called
double timer_stop(TimerInfo *timer)
double clock_end_value
time stamp when the timer was stopped
double duration_sec
duration between clock_start_value and clock_end_value in seconds
void timer_start(TimerInfo *timer)