now.pass.cpp 710 B

123456789101112131415161718192021222324252627282930
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // UNSUPPORTED: libcpp-has-no-monotonic-clock
  10. // <chrono>
  11. // steady_clock
  12. // static time_point now();
  13. #include <chrono>
  14. #include <cassert>
  15. #include "test_macros.h"
  16. int main(int, char**)
  17. {
  18. typedef std::chrono::steady_clock C;
  19. C::time_point t1 = C::now();
  20. C::time_point t2 = C::now();
  21. assert(t2 >= t1);
  22. return 0;
  23. }