mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
fix sleepmillis
This commit is contained in:
parent
ebaf4292d6
commit
80c3078d1a
@ -176,11 +176,12 @@ namespace mongo {
|
||||
inline void sleepmillis(int s) {
|
||||
boost::xtime xt;
|
||||
boost::xtime_get(&xt, boost::TIME_UTC);
|
||||
if( s >= 1000 ) {
|
||||
xt.sec += s/1000;
|
||||
s-=1000;
|
||||
}
|
||||
xt.nsec += s * 1000000;
|
||||
xt.sec += ( s / 1000 );
|
||||
xt.nsec += ( s % 1000 ) * 1000000;
|
||||
if ( xt.nsec >= 1000000000 ) {
|
||||
xt.nsec -= 1000000000;
|
||||
xt.sec++;
|
||||
}
|
||||
boost::thread::sleep(xt);
|
||||
}
|
||||
// note this wraps
|
||||
|
Loading…
Reference in New Issue
Block a user