2 // high_resolution_timer.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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)
11 #ifndef BOOST_ASIO_HIGH_RESOLUTION_TIMER_HPP
12 #define BOOST_ASIO_HIGH_RESOLUTION_TIMER_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
20 #if defined(BOOST_ASIO_HAS_STD_CHRONO) \
21 || defined(BOOST_ASIO_HAS_BOOST_CHRONO) \
22 || defined(GENERATING_DOCUMENTATION)
24 #if defined(BOOST_ASIO_HAS_STD_CHRONO)
26 #elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
27 # include <boost/chrono/system_clocks.hpp>
30 #include <boost/asio/basic_waitable_timer.hpp>
35 #if defined(GENERATING_DOCUMENTATION)
36 /// Typedef for a timer based on the high resolution clock.
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:
42 * typedef basic_waitable_timer<boost::chrono::high_resolution_clock> timer;
45 typedef basic_waitable_timer<
46 chrono::high_resolution_clock>
47 high_resolution_timer;
48 #elif defined(BOOST_ASIO_HAS_STD_CHRONO)
49 typedef basic_waitable_timer<
50 std::chrono::high_resolution_clock>
51 high_resolution_timer;
52 #elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
53 typedef basic_waitable_timer<
54 boost::chrono::high_resolution_clock>
55 high_resolution_timer;
61 #endif // defined(BOOST_ASIO_HAS_STD_CHRONO)
62 // || defined(BOOST_ASIO_HAS_BOOST_CHRONO)
63 // || defined(GENERATING_DOCUMENTATION)
65 #endif // BOOST_ASIO_HIGH_RESOLUTION_TIMER_HPP