Boost logo

Boost Users :

From: Jean-Sebastien Stoezel (js.stoezel_at_[hidden])
Date: 2008-07-05 17:17:14


Great thanks!

On 5-Jul-08, at 3:20 PM, Anthony Williams wrote:

> Jean-Sebastien Stoezel <js.stoezel_at_[hidden]> writes:
>
>> I would like to relinquish the CPU from a thread so I thought using
>> boost::thread::sleep(...). However, I have no idea how to initialize
>> its argument. It looks like this is a boost::system_time. How to
>> initiliaze such a type so my thread waits 20ms, 100ms...!?
>
> You can use
>
> boost::thread::sleep(boost::get_system_time()
> +boost::posix_time::milliseconds(20));
>
> or use the new this_thread namespace version of sleep:
>
> boost::this_thread::sleep(boost::posix_time::milliseconds(20));
>
> Anthony
> --
> Anthony Williams | Just Software Solutions Ltd
> Custom Software Development | http://www.justsoftwaresolutions.co.uk
> Registered in England, Company Number 5478976.
> Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net