Boost logo

Boost Users :

From: Forever Kid (foreverkid3_at_[hidden])
Date: 2006-12-12 00:30:13


What is the resolution of the boost sleep() function?

This sleeps for about 3 seconds:

int main(int argc, char* argv[])
{
    boost::xtime xTime;
    int xt = boost::xtime_get(&xTime,
boost::TIME_UTC);
    xTime.sec += 3;
    boost::thread::sleep(xTime);
    return 0;
}

What about sleeping for ~100 millseconds? How is that
accomplished?

Does this work?
   
xTime.nsec += 100000;
boost::thread::sleep(xTime);

Boost: 1_33_1
Linux: 2.6
GCC: 4.1.1

Thanks much,
Graham

 
____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now.


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