chrono.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // detail/chrono.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_DETAIL_CHRONO_HPP
  11. #define ASIO_DETAIL_CHRONO_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 <chrono>
  17. namespace asio {
  18. namespace chrono {
  19. using std::chrono::duration;
  20. using std::chrono::time_point;
  21. using std::chrono::duration_cast;
  22. using std::chrono::nanoseconds;
  23. using std::chrono::microseconds;
  24. using std::chrono::milliseconds;
  25. using std::chrono::seconds;
  26. using std::chrono::minutes;
  27. using std::chrono::hours;
  28. using std::chrono::time_point_cast;
  29. #if defined(ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK)
  30. typedef std::chrono::monotonic_clock steady_clock;
  31. #else // defined(ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK)
  32. using std::chrono::steady_clock;
  33. #endif // defined(ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK)
  34. using std::chrono::system_clock;
  35. using std::chrono::high_resolution_clock;
  36. } // namespace chrono
  37. } // namespace asio
  38. #endif // ASIO_DETAIL_CHRONO_HPP