]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/example/cpp03/tutorial/timer2/timer.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / asio / example / cpp03 / tutorial / timer2 / timer.cpp
1 //
2 // timer.cpp
3 // ~~~~~~~~~
4 //
5 // Copyright (c) 2003-2017 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
11 #include <iostream>
12 #include <boost/asio.hpp>
13 #include <boost/date_time/posix_time/posix_time.hpp>
14
15 void print(const boost::system::error_code& /*e*/)
16 {
17 std::cout << "Hello, world!" << std::endl;
18 }
19
20 int main()
21 {
22 boost::asio::io_context io;
23
24 boost::asio::deadline_timer t(io, boost::posix_time::seconds(5));
25 t.async_wait(&print);
26
27 io.run();
28
29 return 0;
30 }