Boost logo

Boost :

Subject: [boost] [thread] sleep() with time_duration?
From: Boris (boriss_at_[hidden])
Date: 2008-11-14 05:38:54

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);

It would be nice if it was possible to pass a time_duration object to
sleep() directly:


This would also be consistent with the deadline_timer in Boost.Asio whose
constructor accepts both a time and a time_duration.


Boost list run by bdawes at, gregod at, cpdaniel at, john at