C++11this_threadsleep_until(11)
原文地址:http://www.cplusplus.com/reference/thread/this\_thread/sleep\_until/
function
std::this_thread::sleep_until
template <class Clock, class Duration>
void sleep_until (const chrono::time_point<Clock,Duration>& abs_time);
Sleep until time point
Blocks the calling thread until abs_time.
阻塞当前线程直到abs_time时间点到来。
The execution of the current thread is stopped until at least abs_time, while other threads may continue to advance.
该线程阻塞至少直到时间点abs_time到来。其他线程可能提前。
Parameters
abs_time
A point in time when the calling thread shall resume its execution.
Note that multi-threading management operations may cause certain delays beyond this.
time_point is an object that represents a specific absolute time.
线程应该恢复执行的时间点。
Return value
none
Example
1 | 1 |
1 | // this_thread::sleep_for example |
Output (after an avg. of 30 seconds):
Current time: 11:52:36
Waiting for the next minute to begin…
11:53:00 reached!
Exception safety
If the type of abs_time never throws exceptions (like if it only uses values from the standard clocks provided in header
—————————————————————————————————————————————————————————————————
//写的错误或者不好的地方请多多指导,可以在下面留言或者点击左上方邮件地址给我发邮件,指出我的错误以及不足,以便我修改,更好的分享给大家,谢谢。
转载请注明出处:http://blog.csdn.net/qq844352155
author:天下无双
Email:coderguang@gmail.com
2014-9-4
于GDUT
——————————————————————————————————————————————————————————————————
- 本文作者: royalchen
- 本文链接: http://www.royalchen.com/2016/02/24/c11this-threadsleep-until11/
- 版权声明: 本博客所有文章除特别声明外,均采用 MIT 许可协议。转载请注明出处!