56 public:
Time(
const struct timeval &_tv);
60 public:
Time(
const struct timespec &_tv);
65 public:
Time(int32_t _sec, int32_t _nsec);
69 public:
Time(
double _time);
72 public:
virtual ~Time();
88 public:
void Set(int32_t _sec, int32_t _nsec);
92 public:
void Set(
double _seconds);
96 public:
double Double()
const;
100 public:
float Float()
const;
260 public:
bool operator ==(
const struct timeval &_tv)
const;
265 public:
bool operator ==(
const struct timespec &_tv)
const;
280 public:
bool operator!=(
const struct timeval &_tv)
const;
285 public:
bool operator!=(
const struct timespec &_tv)
const;
300 public:
bool operator<(
const struct timeval &_tv)
const;
305 public:
bool operator<(
const struct timespec &_tv)
const;
315 public:
bool operator<(
double _time)
const;
320 public:
bool operator<=(
const struct timeval &_tv)
const;
325 public:
bool operator<=(
const struct timespec &_tv)
const;
340 public:
bool operator>(
const struct timeval &_tv)
const;
345 public:
bool operator>(
const struct timespec &_tv)
const;
355 public:
bool operator>(
double _time)
const;
360 public:
bool operator>=(
const struct timeval &_tv)
const;
365 public:
bool operator>=(
const struct timespec &_tv)
const;
381 {
return _sec * 1e-9;}
387 {
return _ms * 1e-6;}
393 {
return _ms * 1e-3;}
402 _out << _time.
sec <<
" " << _time.
nsec;
414 _in.setf(std::ios_base::skipws);
415 _in >> _time.
sec >> _time.
nsec;
426 private:
static Time wallTime;
429 private:
static std::string wallTimeISO;
433 private:
inline void Correct()
436 if (this->
sec > 0 && this->
nsec < 0)
438 int32_t n = abs(this->
nsec / 1e9) + 1;
440 this->
nsec += n * 1e9;
442 if (this->sec < 0 && this->
nsec > 0)
444 int32_t n = abs(this->
nsec / 1e9) + 1;
446 this->
nsec -= n * 1e9;
450 this->
sec += this->
nsec /
static_cast<int32_t
>(1e9);
451 this->
nsec = this->
nsec %
static_cast<int32_t
>(1e9);
453 private:
static struct timespec clockResolution;