# std::this_thread::sleep_until

From cppreference.com
< cpp‎ | thread

Defined in header `<thread>` |  |
template< class Clock, class Duration > void sleep_until( const std::chrono::time_point<Clock,Duration>& sleep_time ); |  | (since C++11)

Blocks the execution of the current thread until specified `sleep_time` has been reached.

The clock tied to `sleep_time` is used, which means that adjustments of the clock are taken into account. Thus, the duration of the block might, but might not, be less or more than sleep_time - Clock::now() at the time of the call, depending on the direction of the adjustment. The function also may block for longer than until after `sleep_time` has been reached due to scheduling or resource contention delays.

### Parameters

sleep_time | - | time to block until

### Return value

(none)

### Exceptions

Any exception thrown by `Clock` or `Duration` (clocks and durations provided by the standard library never throw)

### See also

sleep_for (C++11) | stops the execution of the current thread for a specified time duration (function)
C documentation for thrd_sleep

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/thread/sleep_until&oldid=90293"