17#ifndef CYBER_TIME_TIME_H_
18#define CYBER_TIME_TIME_H_
36 explicit Time(uint64_t nanoseconds);
37 explicit Time(
int nanoseconds);
38 explicit Time(
double seconds);
39 Time(uint32_t seconds, uint32_t nanoseconds);
106 uint64_t nanoseconds_ = 0;
Cyber has builtin time type Time.
bool operator>(const Time &rhs) const
uint64_t ToMicrosecond() const
convert time to microsecond (us).
bool operator<(const Time &rhs) const
Time & operator+=(const Duration &rhs)
Time operator+(const Duration &rhs) const
Duration operator-(const Time &rhs) const
bool operator!=(const Time &rhs) const
bool IsZero() const
determine if time is 0
static void SleepUntil(const Time &time)
Sleep Until time.
bool operator<=(const Time &rhs) const
bool operator==(const Time &rhs) const
bool operator>=(const Time &rhs) const
Time & operator-=(const Duration &rhs)
uint64_t ToNanosecond() const
convert time to nanosecond.
static Time Now()
get the current time.
std::string ToString() const
convert time to a string.
Time & operator=(const Time &other)
double ToSecond() const
convert time to second.
std::ostream & operator<<(std::ostream &os, const Duration &rhs)