[Boost-bugs] [Boost C++ Libraries] #8136: boost::this_thread::sleep_for() sleeps longer than it should in Windows

Subject: [Boost-bugs] [Boost C++ Libraries] #8136: boost::this_thread::sleep_for() sleeps longer than it should in Windows
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-21 13:16:09


#8136: boost::this_thread::sleep_for() sleeps longer than it should in Windows
---------------------------------------------------+------------------------
 Reporter: Ondrej Siler <ondrej.siler@…> | Owner: anthonyw
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: |
---------------------------------------------------+------------------------
 Calling the this_thread::sleep_for() results in a sleep almost twice as
 long as desired.

 code:
 {{{
 #include <iostream>
 #include <boost/thread.hpp>

 int main(int argc, char * argv[])
 {
   boost::chrono::system_clock::time_point start =
 boost::chrono::system_clock::now();
   boost::this_thread::sleep_for(boost::chrono::seconds(1));
   boost::chrono::system_clock::time_point end =
 boost::chrono::system_clock::now();
   std::cout <<
 (boost::chrono::duration_cast<boost::chrono::microseconds>(end -
 start)).count() << std::endl;
   return 0;
 }

 }}}

 When built in MS Windows 7 x64, the program outputs
 2000114

 The same code in linux x64 outputs
 1000298

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8136>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC