clock¶
- group turbo_times_clock
Functions
-
int64_t get_current_time_nanos()¶
Returns the current time, expressed as a count of nanoseconds since the Unix Epoch.
Prefer
turbo::time_now()instead for all but the most performance-sensitive cases (i.e. when you are calling this function hundreds of thousands of times per second).See also
turbo::time_now()See also
- Returns:
-
inline int64_t get_current_time_millis()¶
Returns the current time, expressed as a count of milliseconds since the Unix Epoch.
Prefer
turbo::time_now()instead for all but the most performance-sensitive cases (i.e. when you are calling this function hundreds of thousands of times per second).See also
turbo::time_now()See also
- Returns:
-
inline int64_t get_current_time_seconds()¶
Returns the current time, expressed as a count of seconds since the Unix Epoch.
Prefer
turbo::time_now()instead for all but the most performance-sensitive cases (i.e. when you are calling this function hundreds of thousands of times per second).See also
turbo::time_now()See also
- Returns:
-
inline void sleep_for(turbo::Duration duration)¶
Sleeps for the specified duration, expressed as an
turbo::Duration.See also
turbo::DurationNote
Signal interruptions will not reduce the sleep duration. Returns immediately when passed a nonpositive duration.
- Parameters:
duration – The duration to sleep for.
-
inline void sleep_until(turbo::Time time)¶
Sleeps until the specified time, expressed as an
turbo::Time.See also
Note
Signal interruptions will not reduce the sleep duration. Returns immediately when passed a time in the past.
- Parameters:
time – The time to sleep until.
-
inline turbo::Time from_now(timespec ts)¶
Returns the current time, expressed as an
turbo::Timeabsolute time value.- Returns:
-
int64_t get_current_time_nanos()¶