steady_clock.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. {
  20. #ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
  21. class _LIBCPP_EXPORTED_FROM_ABI steady_clock
  22. {
  23. public:
  24. typedef nanoseconds duration;
  25. typedef duration::rep rep;
  26. typedef duration::period period;
  27. typedef chrono::time_point<steady_clock, duration> time_point;
  28. static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = true;
  29. static time_point now() _NOEXCEPT;
  30. };
  31. #endif
  32. } // namespace chrono
  33. _LIBCPP_END_NAMESPACE_STD
  34. #endif // _LIBCPP___CHRONO_STEADY_CLOCK_H