12 #ifndef ROC_CORE_TIME_H_
13 #define ROC_CORE_TIME_H_
const nanoseconds_t Millisecond
One millisecond represented in nanoseconds.
const nanoseconds_t Nanosecond
One nanosecond represented in nanoseconds.
bool ns_equal_delta(nanoseconds_t a, nanoseconds_t b, nanoseconds_t delta)
Compares a and b if they close enough.
const nanoseconds_t Day
One day represented in nanoseconds.
nanoseconds_t timestamp(clock_t clock)
Get current timestamp in nanoseconds.
std::tm nanoseconds_2_tm(nanoseconds_t timestamp)
Convert timestamp in nanoseconds format to broken-down time.
const nanoseconds_t Second
One second represented in nanoseconds.
const nanoseconds_t Minute
One minute represented in nanoseconds.
const nanoseconds_t Microsecond
One microsecond represented in nanoseconds.
@ ClockUnix
Real-time Unix-time UTC clock.
@ ClockMonotonic
Virtual monotonic clock.
void sleep_for(clock_t clock, nanoseconds_t duration)
Sleep specified amount of time.
const nanoseconds_t Hour
One hour represented in nanoseconds.
void sleep_until(clock_t clock, nanoseconds_t timestamp)
Sleep until the specified absolute time point has been reached.
nanoseconds_t tm_2_nanoseconds(std::tm tm)
Convert timestamp from broken-down time to nanoseconds format.
int64_t nanoseconds_t
Nanoseconds.
Commonly used types and functions.