steady_timer.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // steady_timer.hpp
  3. // ~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2023 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. #ifndef ASIO_STEADY_TIMER_HPP
  11. #define ASIO_STEADY_TIMER_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #include "asio/basic_waitable_timer.hpp"
  17. #include "asio/detail/chrono.hpp"
  18. namespace asio {
  19. /// Typedef for a timer based on the steady clock.
  20. /**
  21. * This typedef uses the C++11 @c <chrono> standard library facility, if
  22. * available. Otherwise, it may use the Boost.Chrono library. To explicitly
  23. * utilise Boost.Chrono, use the basic_waitable_timer template directly:
  24. * @code
  25. * typedef basic_waitable_timer<boost::chrono::steady_clock> timer;
  26. * @endcode
  27. */
  28. typedef basic_waitable_timer<chrono::steady_clock> steady_timer;
  29. } // namespace asio
  30. #endif // ASIO_STEADY_TIMER_HPP