#define MSP_TIME_TIMEDELTA_H_
#include <time.h>
+#include <sys/time.h>
#include <ostream>
#include "types.h"
TimeDelta, divide with one of the values in units.h.
*/
void fill_timespec(timespec &ts) const { ts.tv_sec=usec/1000000; ts.tv_nsec=(usec%1000000)*1000; }
+
+ void fill_timeval(timeval &tv) const { tv.tv_sec=usec/1000000; tv.tv_usec=usec%1000000; }
#endif
TimeDelta operator+(const TimeDelta &t) const { return TimeDelta(usec+t.usec); }
*/
RawTime raw() const { return usec; }
- time_t to_unixtime() { return usec/1000000LL; }
+ time_t to_unixtime() const { return usec/1000000LL; }
TimeStamp operator+(const TimeDelta &t) const { return TimeStamp(usec+t.raw()); }
TimeStamp &operator+=(const TimeDelta &t) { usec+=t.raw(); return *this; }