Boost logo

Boost Users :

From: Johan Råde (rade_at_[hidden])
Date: 2008-04-17 06:47:28


Johan Råde wrote:
> I want to do a timed join, with a relative time of 0.1s.
> I can not figure out from the docs how to do this.
> I find the prototypes somewhat mystifying:
>
> bool timed_join(const system_time& wait_until);
>
> template<typename TimeDuration> bool timed_join(TimeDuration const& rel_time);
>
> What is system_time?
> What should TimeDuration be?
>
> I'm using Windows.
>
> Thank you,
> Johan Råde

I figured out the answer myself:

        int n = (int)boost::posix_time::time_duration::ticks_per_second() / 10;
        boost::posix_time::time_duration delay(0,0,0,n);
        thr.timed_join(delay);

I bit more complex than I had expected.

--Johan


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