diff options
Diffstat (limited to 'libcxx/test/support')
| -rw-r--r-- | libcxx/test/support/filesystem_test_helper.hpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libcxx/test/support/filesystem_test_helper.hpp b/libcxx/test/support/filesystem_test_helper.hpp index fdab4d6153f..7e3c7399a10 100644 --- a/libcxx/test/support/filesystem_test_helper.hpp +++ b/libcxx/test/support/filesystem_test_helper.hpp @@ -388,9 +388,13 @@ inline std::error_code GetTestEC() { // available in single-threaded mode. void SleepFor(std::chrono::seconds dur) { using namespace std::chrono; - const auto curr_time = steady_clock::now(); - auto wake_time = curr_time + dur; - while (steady_clock::now() < wake_time) +#if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) + using Clock = system_clock; +#else + using Clock = steady_clock; +#endif + const auto wake_time = Clock::now() + dur; + while (Clock::now() < wake_time) ; } |

