xtime.cpp 463 B

123456789101112131415161718
  1. // Copyright (C) 2001-2003
  2. // William E. Kempf
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. #define BOOST_THREAD_VERSION 2
  7. #include <boost/thread/thread_only.hpp>
  8. #include <boost/thread/xtime.hpp>
  9. int main()
  10. {
  11. boost::xtime xt;
  12. boost::xtime_get(&xt, boost::TIME_UTC_);
  13. xt.sec += 1;
  14. boost::thread::sleep(xt); // Sleep for 1 second
  15. }