timer.cpp 503 B

123456789101112131415161718192021222324
  1. //
  2. // timer.cpp
  3. // ~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #include <iostream>
  11. #include <boost/asio.hpp>
  12. int main()
  13. {
  14. boost::asio::io_context io;
  15. boost::asio::steady_timer t(io, boost::asio::chrono::seconds(5));
  16. t.wait();
  17. std::cout << "Hello, world!" << std::endl;
  18. return 0;
  19. }