summaryrefslogtreecommitdiffstats
blob: 5a0d7291c4253603a3b5dfe1d7556005f4e2639d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Copyright (c) 2010 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#include <Swiften/Base/sleep.h>

#include <boost/thread.hpp>
#include <boost/version.hpp>

namespace Swift {

void sleep(unsigned int msecs) {
    boost::xtime xt;
#if BOOST_VERSION >= 105000
    boost::xtime_get(&xt, boost::TIME_UTC_);
#else
    boost::xtime_get(&xt, boost::TIME_UTC);
#endif
    xt.nsec += msecs*1000000;
    boost::thread::sleep(xt);
}

}