steady_clock.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef _LIBCPP___CHRONO_STEADY_CLOCK_H
  10. #define _LIBCPP___CHRONO_STEADY_CLOCK_H
  11. #include <__chrono/duration.h>
  12. #include <__chrono/time_point.h>
  13. #include <__config>
  14. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  15. # pragma GCC system_header
  16. #endif
  17. _LIBCPP_BEGIN_NAMESPACE_STD
  18. namespace chrono {
  19. #ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
  20. class _LIBCPP_EXPORTED_FROM_ABI steady_clock {
  21. public:
  22. typedef nanoseconds duration;
  23. typedef duration::rep rep;
  24. typedef duration::period period;
  25. typedef chrono::time_point<steady_clock, duration> time_point;
  26. static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = true;
  27. static time_point now() _NOEXCEPT;
  28. };
  29. #endif
  30. } // namespace chrono
  31. _LIBCPP_END_NAMESPACE_STD
  32. #endif // _LIBCPP___CHRONO_STEADY_CLOCK_H