5 #ifndef __pinocchio_utils_timer2_hpp__
6 #define __pinocchio_utils_timer2_hpp__
18 clock_gettime(CLOCK_MONOTONIC, &start_);
23 clock_gettime(CLOCK_MONOTONIC, &start_);
26 inline double get_duration()
28 clock_gettime(CLOCK_MONOTONIC, &finish_);
29 duration_ =
static_cast<double>(finish_.tv_sec - start_.tv_sec) * 1000000;
30 duration_ +=
static_cast<double>(finish_.tv_nsec - start_.tv_nsec) / 1000;
31 return duration_ / 1000.;
34 inline double get_us_duration()
36 clock_gettime(CLOCK_MONOTONIC, &finish_);
37 duration_ =
static_cast<double>(finish_.tv_sec - start_.tv_sec) * 1000000;
38 duration_ +=
static_cast<double>(finish_.tv_nsec - start_.tv_nsec) / 1000;
43 struct timespec start_;
44 struct timespec finish_;
Main pinocchio namespace.