clock

group turbo_times_clock

Functions

turbo::Time time_now()

Returns the current time, expressed as an turbo::Time absolute time value.

Returns:

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).

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).

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).

Returns:

inline void sleep_for(turbo::Duration duration)

Sleeps for the specified duration, expressed as an turbo::Duration.

See also

turbo::Duration

Note

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

turbo::Time

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.