
14 Nov
2008
14 Nov
'08
10:38 a.m.
If I want a thread to sleep for five seconds the shortest code I could come up with is: boost::system_time time = boost::get_system_time(); time += boost::posix_time::seconds(5); boost::thread::sleep(time); It would be nice if it was possible to pass a time_duration object to sleep() directly: boost::thread::sleep(boost::posix_time::seconds(5)); This would also be consistent with the deadline_timer in Boost.Asio whose constructor accepts both a time and a time_duration. Boris