2
0
mirror of https://github.com/boostorg/cobalt.git synced 2026-02-03 09:02:12 +00:00
Files
cobalt/doc/reference/io/sleep.adoc
Klemens Morgenstern 60e5c163f6 [io] sleep
2025-06-24 18:15:10 +08:00

23 lines
642 B
Plaintext

== cobalt/io/sleep.hpp
The sleep operations are convenience wrappers for timers.
Every sleep operation creates a timer,
so it is generally more efficient to reuse a timer.
[source,cpp]
----
// Waits using a steady_timer.
template<typename Duration>
inline auto sleep(const std::chrono::time_point<std::chrono::steady_clock, Duration> & tp);
// Waits using a system_timer.
template<typename Duration>
inline auto sleep(const std::chrono::time_point<std::chrono::system_clock, Duration> & tp);
// Waits using a steady_timer.
template<typename Rep, typename Period>
inline auto sleep(const std::chrono::duration<Rep, Period> & dur);
----