Index: libcxx/src/support/win32/thread_win32.cpp =================================================================== --- libcxx/src/support/win32/thread_win32.cpp +++ libcxx/src/support/win32/thread_win32.cpp @@ -246,10 +246,8 @@ void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns) { - using namespace chrono; - // round-up to the nearest milisecond - milliseconds __ms = - duration_cast(__ns + chrono::nanoseconds(999999)); + // round-up to the nearest millisecond + chrono::milliseconds __ms = std::chrono::ceil(__ns); // FIXME(compnerd) this should be an alertable sleep (WFSO or SleepEx) Sleep(__ms.count()); }