| 75 | time_t_clock, time_t_wait_traits> time_t_timer; |
| 76 | |
| 77 | int main() |
| 78 | { |
| 79 | try |
| 80 | { |
| 81 | boost::asio::io_context io_context; |
| 82 | |
| 83 | time_t_timer timer(io_context); |
| 84 | |
| 85 | timer.expires_after(std::chrono::seconds(5)); |
| 86 | std::cout << "Starting synchronous wait\n"; |
| 87 | timer.wait(); |
| 88 | std::cout << "Finished synchronous wait\n"; |
| 89 | |
| 90 | timer.expires_after(std::chrono::seconds(5)); |
| 91 | std::cout << "Starting asynchronous wait\n"; |
| 92 | timer.async_wait( |
| 93 | [](const boost::system::error_code& /*error*/) |
| 94 | { |
| 95 | std::cout << "timeout\n"; |
| 96 | }); |
| 97 | io_context.run(); |
| 98 | std::cout << "Finished asynchronous wait\n"; |
| 99 | } |
| 100 | catch (std::exception& e) |
| 101 | { |
| 102 | std::cout << "Exception: " << e.what() << "\n"; |
| 103 | } |
| 104 | |
| 105 | return 0; |
| 106 | } |
nothing calls this directly
no test coverage detected