50 public:
Time(
const struct timeval &_tv);
54 public:
Time(
const struct timespec &_tv);
59 public:
Time(int32_t _sec, int32_t _nsec);
63 public:
Time(
double _time);
66 public:
virtual ~Time();
78 public:
void Set(int32_t _sec, int32_t _nsec);
82 public:
void Set(
double _seconds);
86 public:
double Double()
const;
90 public:
float Float()
const;
242 public:
bool operator ==(
const struct timeval &_tv)
const;
247 public:
bool operator ==(
const struct timespec &_tv)
const;
262 public:
bool operator!=(
const struct timeval &_tv)
const;
267 public:
bool operator!=(
const struct timespec &_tv)
const;
282 public:
bool operator<(
const struct timeval &_tv)
const;
287 public:
bool operator<(
const struct timespec &_tv)
const;
297 public:
bool operator<(
double _time)
const;
302 public:
bool operator<=(
const struct timeval &_tv)
const;
307 public:
bool operator<=(
const struct timespec &_tv)
const;
322 public:
bool operator>(
const struct timeval &_tv)
const;
327 public:
bool operator>(
const struct timespec &_tv)
const;
337 public:
bool operator>(
double _time)
const;
342 public:
bool operator>=(
const struct timeval &_tv)
const;
347 public:
bool operator>=(
const struct timespec &_tv)
const;
363 {
return _sec * 1e-9;}
369 {
return _ms * 1e-6;}
375 {
return _ms * 1e-3;}
384 _out << _time.
sec <<
" " << _time.
nsec;
396 _in.setf(std::ios_base::skipws);
397 _in >> _time.
sec >> _time.
nsec;
408 private:
static Time wallTime;
412 private:
inline void Correct()
415 if (this->
sec > 0 && this->
nsec < 0)
417 int32_t n = abs(this->
nsec / 1e9) + 1;
419 this->
nsec += n * 1e9;
421 if (this->sec < 0 && this->
nsec > 0)
423 int32_t n = abs(this->
nsec / 1e9) + 1;
425 this->
nsec -= n * 1e9;
429 this->
sec += this->
nsec /
static_cast<int32_t
>(1e9);
430 this->
nsec = this->
nsec %
static_cast<int32_t
>(1e9);
432 private:
static struct timespec clock_resolution;