Boost C++ Libraries: Ticket #3179: Sleep with local_time https://svn.boost.org/trac10/ticket/3179 <p> When calling sleep with an absolute time, it sleeps about two hours instead of one second in code similar to the below example. </p> <p> ptime now = second_clock::local_time(); this_thread::sleep( now + second(1) ) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3179 Trac 1.4.3 anonymous Mon, 15 Jun 2009 18:39:45 GMT <link>https://svn.boost.org/trac10/ticket/3179#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3179#comment:1</guid> <description> <p> Replying to <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3179" title="#3179: Bugs: Sleep with local_time (closed: fixed)">anonymous</a>: </p> <blockquote class="citation"> <p> When calling sleep with an absolute time, it sleeps about two hours instead of one second in code similar to the below example. </p> <p> ptime now = second_clock::local_time(); this_thread::sleep( now + second(1) ) </p> </blockquote> <p> After a lot of headache I think that might is due to a missmatch with utc and local time. Please make it possible to sleep until a "local time" (local time zone) and write something about it in the documentations, I haven't found anything special about which type of time should be used. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 20 Nov 2009 11:43:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3179#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3179#comment:2</guid> <description> <p> The this_thread::sleep prototype is </p> <pre class="wiki"> template&lt;typename TimeDuration&gt; void sleep(TimeDuration const&amp; rel_time); </pre><p> The <a class="missing wiki">TimeDuration</a> you can pass as parameter must be one for which system_time+<a class="missing wiki">TimeDuration</a> is defined. </p> <p> You are right that this should be documented. BTW the interface for thread::sleep is </p> <pre class="wiki"> void thread::sleep(system_time const&amp; abs_time); </pre><p> Anthony, to be coherent, shouldn't you add the absolute time interface on the namespace this_thread? Waiting fro Boost.Chrono, what about adding </p> <pre class="wiki">void sleep(system_time const&amp; abs_time); void sleep_until(system_time const&amp; abs_time); template &lt;class TimeDuration&gt; void sleep_for(TimeDuration const&amp; rel_time); </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 08 Jun 2010 21:26:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3179#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3179#comment:3</guid> <description> <p> This is already implemented, but the documentation is not updated. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Anthony Williams</dc:creator> <pubDate>Wed, 09 Jun 2010 06:49:07 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3179#comment:4 https://svn.boost.org/trac10/ticket/3179#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Updated documentation on trunk. </p> Ticket