MCPcopy Create free account
hub / github.com/boostorg/cobalt / co_main

Function co_main

example/delay.cpp:13–19  ·  view source on GitHub ↗

tag::timer_example[]

Source from the content-addressed store, hash-verified

11
12// tag::timer_example[]
13cobalt::main co_main(int argc, char * argv[]) // <1>
14{
15 asio::steady_timer tim{co_await asio::this_coro::executor, // <2>
16 std::chrono::milliseconds(std::stoi(argv[1]))}; // <3>
17 co_await tim.async_wait(cobalt::use_op); // <4>
18 co_return 0; // <5>
19}
20// end::timer_example[]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected