1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include "ipm/ipx/timer.h" #include <cstdio> namespace ipx { Timer::Timer(const double offset) : offset_(offset) { Reset(true); } void Timer::Reset(const bool first) { if (!first) offset_ -= t0_; t0_ = read(); if (!first) offset_ += t0_; } } // namespace ipx