MCPcopy Create free account
hub / github.com/boostorg/asio / main

Function main

example/cpp14/deferred/deferred_1.cpp:16–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14using boost::asio::deferred;
15
16int main()
17{
18 boost::asio::io_context ctx;
19
20 boost::asio::steady_timer timer(ctx);
21 timer.expires_after(std::chrono::seconds(1));
22
23 auto deferred_op = timer.async_wait(deferred);
24
25 std::move(deferred_op)(
26 [](boost::system::error_code ec)
27 {
28 std::cout << "timer wait finished: " << ec.message() << "\n";
29 }
30 );
31
32 ctx.run();
33
34 return 0;
35}

Callers

nothing calls this directly

Calls 3

expires_afterMethod · 0.45
async_waitMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected