[libcxx] r273089 - Use monotonic clock in synthetic SleepFor test helper

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 18 10:51:12 PDT 2016


Author: ericwf
Date: Sat Jun 18 12:51:11 2016
New Revision: 273089

URL: http://llvm.org/viewvc/llvm-project?rev=273089&view=rev
Log:
Use monotonic clock in synthetic SleepFor test helper

Modified:
    libcxx/trunk/test/support/filesystem_test_helper.hpp

Modified: libcxx/trunk/test/support/filesystem_test_helper.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/filesystem_test_helper.hpp?rev=273089&r1=273088&r2=273089&view=diff
==============================================================================
--- libcxx/trunk/test/support/filesystem_test_helper.hpp (original)
+++ libcxx/trunk/test/support/filesystem_test_helper.hpp Sat Jun 18 12:51:11 2016
@@ -388,9 +388,9 @@ inline std::error_code GetTestEC() {
 // available in single-threaded mode.
 void SleepFor(std::chrono::seconds dur) {
     using namespace std::chrono;
-    const auto curr_time = system_clock::now();
+    const auto curr_time = steady_clock::now();
     auto wake_time = curr_time + dur;
-    while (system_clock::now() < wake_time)
+    while (steady_clock::now() < wake_time)
         ;
 }
 




More information about the cfe-commits mailing list