38 #include "ros/duration.h" 51 Time() : sec(0), nsec(0) {}
52 Time(uint32_t _sec, uint32_t _nsec) : sec(_sec), nsec(_nsec)
59 return (
double)sec + 1e-9 * (double)nsec;
61 void fromSec(
double t)
63 sec = (uint32_t) floor(t);
64 nsec = (uint32_t) round((t - sec) * 1e9);
69 return (uint32_t)sec * 1000000000ull + (uint32_t)nsec;
71 Time& fromNSec(int32_t t);
73 Time& operator +=(
const Duration &rhs);
74 Time& operator -=(
const Duration &rhs);
static void setNow(const Time &new_now)
ROSTIME_DECL void normalizeSecNSec(uint32_t &sec, uint32_t &nsec)