test_11796.cpp 729 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (C) 2015 Vicente Botet
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #include <boost/thread.hpp>
  6. #include <boost/chrono.hpp>
  7. #include <iostream>
  8. boost::thread th;
  9. int main()
  10. {
  11. for (auto ti = 0; ti < 1000; ti++)
  12. {
  13. th = boost::thread([ti]()
  14. {
  15. boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
  16. std::cout << ti << std::endl;
  17. });
  18. }
  19. std::string st;
  20. std::cin >> st;
  21. // for (int i = 0; i < 10; ++i) {
  22. // std::cout << "." << i << std::endl;
  23. // boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
  24. // }
  25. th.join();
  26. return 0;
  27. }