[thrad] #3179 Sleep with local_time

Hi, Anthony this ticket have a simple solution. https://svn.boost.org/trac/boost/ticket/3179 Nest follows my contents Replying to anonymous: When calling sleep with an absolute time, it sleeps about two hours instead of one second in code similar to the below example. ptime now = second_clock::local_time(); this_thread::sleep( now + second(1) ) 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. Changed 5 days ago by viboes ΒΆ The this_thread::sleep prototype is template<typename TimeDuration> void sleep(TimeDuration const& rel_time); The TimeDuration? you can pass as parameter must be one for which system_time+TimeDuration? is defined. You are right that this should be documented. BTW the interface for thread::sleep is void thread::sleep(system_time const& abs_time); Anthony, to be coherent, shouldn't you add the absolute time interface on the namespace this_thread? Waiting fro Boost.Chrono, what about adding void sleep(system_time const& abs_time); void sleep_until(system_time const& abs_time); template <class TimeDuration> void sleep_for(TimeDuration const& rel_time); Best, Vicente -- View this message in context: http://old.nabble.com/-thrad---3179--%09-Sleep-with-local_time-tp26513016p26... Sent from the Boost - Dev mailing list archive at Nabble.com.
participants (1)
-
Vicente Botet Escriba