]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // |
2 | // system_timer.hpp | |
3 | // ~~~~~~~~~~~~~~~~ | |
4 | // | |
5 | // Copyright (c) 2003-2016 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 | #ifndef BOOST_ASIO_SYSTEM_TIMER_HPP | |
12 | #define BOOST_ASIO_SYSTEM_TIMER_HPP | |
13 | ||
14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) | |
15 | # pragma once | |
16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) | |
17 | ||
18 | #include <boost/asio/detail/config.hpp> | |
19 | ||
20 | #if defined(BOOST_ASIO_HAS_STD_CHRONO) \ | |
21 | || defined(BOOST_ASIO_HAS_BOOST_CHRONO) \ | |
22 | || defined(GENERATING_DOCUMENTATION) | |
23 | ||
24 | #if defined(BOOST_ASIO_HAS_STD_CHRONO) | |
25 | # include <chrono> | |
26 | #elif defined(BOOST_ASIO_HAS_BOOST_CHRONO) | |
27 | # include <boost/chrono/system_clocks.hpp> | |
28 | #endif | |
29 | ||
30 | #include <boost/asio/basic_waitable_timer.hpp> | |
31 | ||
32 | namespace boost { | |
33 | namespace asio { | |
34 | ||
35 | #if defined(GENERATING_DOCUMENTATION) | |
36 | /// Typedef for a timer based on the system clock. | |
37 | /** | |
38 | * This typedef uses the C++11 @c <chrono> standard library facility, if | |
39 | * available. Otherwise, it may use the Boost.Chrono library. To explicitly | |
40 | * utilise Boost.Chrono, use the basic_waitable_timer template directly: | |
41 | * @code | |
42 | * typedef basic_waitable_timer<boost::chrono::system_clock> timer; | |
43 | * @endcode | |
44 | */ | |
45 | typedef basic_waitable_timer<chrono::system_clock> system_timer; | |
46 | #elif defined(BOOST_ASIO_HAS_STD_CHRONO) | |
47 | typedef basic_waitable_timer<std::chrono::system_clock> system_timer; | |
48 | #elif defined(BOOST_ASIO_HAS_BOOST_CHRONO) | |
49 | typedef basic_waitable_timer<boost::chrono::system_clock> system_timer; | |
50 | #endif | |
51 | ||
52 | } // namespace asio | |
53 | } // namespace boost | |
54 | ||
55 | #endif // defined(BOOST_ASIO_HAS_STD_CHRONO) | |
56 | // || defined(BOOST_ASIO_HAS_BOOST_CHRONO) | |
57 | // || defined(GENERATING_DOCUMENTATION) | |
58 | ||
59 | #endif // BOOST_ASIO_SYSTEM_TIMER_HPP |