id summary reporter owner description type status milestone component version severity resolution keywords cc 11322 sleep_for() nanoseconds overload will always return too early on windows jlamotte@… viboes "We isolated the issue to the following test: {{{ #include #include int main() { const boost::chrono::nanoseconds SLEEP_DURATION(boost::chrono::milliseconds(500)); const auto SLEEP_DURATION_MS = boost::chrono::duration_cast(SLEEP_DURATION); const auto SLEEP_DURATION_US = boost::chrono::duration_cast(SLEEP_DURATION); const auto SLEEP_DURATION_NANO = boost::chrono::duration_cast(SLEEP_DURATION); const auto SLEEP_DURATION_STEADY = boost::chrono::duration_cast(SLEEP_DURATION); const auto begin = boost::chrono::steady_clock::now(); boost::this_thread::sleep_for(SLEEP_DURATION); const auto end = boost::chrono::steady_clock::now(); const auto sleep_duration = end - begin; const auto sleep_duration_ms = boost::chrono::duration_cast(sleep_duration); const auto sleep_duration_us = boost::chrono::duration_cast(sleep_duration); const auto sleep_duration_nano = boost::chrono::duration_cast(sleep_duration); assert(sleep_duration >= SLEEP_DURATION); assert(sleep_duration_ms >= SLEEP_DURATION_MS); assert(sleep_duration_us >= SLEEP_DURATION_US); assert(sleep_duration_nano >= SLEEP_DURATION_NANO); } }}} It fails with msvc10. If SLEEP_DURATION is a milliseconds instead of nanoseconds, it runs without failure. Stepping in the code shows that the nanoseconds sleep_for() overload does not use a condition variable like the other template sleep_for overloads, which leads to that bug where the sleep took less time than asked (instead of equal or more). It seems that his bug is related to #9720 and #10967 but I'm not sure." Bugs closed Boost 1.60.0 thread Boost 1.55.0 Showstopper fixed