Boost C++ 库

...世界上最受推崇和设计最精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ 编码规范

io_context::run_for - Boost C++ 函数库
PrevUpHomeNext

运行 io_context 对象的事件处理循环,持续指定的时间。

template<
    typename Rep,
    typename Period>
std::size_t run_for(
    const chrono::duration< Rep, Period > & rel_time);

run_for() 函数会阻塞,直到所有工作完成且没有更多的处理程序需要分派,直到 io_context 被停止,或者直到指定的持续时间过去。

参数

rel_time

调用可能阻塞的持续时间。

返回值

执行的处理程序的数量。


PrevUpHomeNext