fork(1) download
  1. #define _GLIBCXX_USE_NANOSLEEP 1
  2. #include <iostream>
  3. #include <chrono>
  4. #include <thread>
  5.  
  6. int main()
  7. {
  8. for (int i = 0; i < 5; i++)
  9. {
  10. std::cout << "Waiting..." << std::endl;
  11. std::this_thread::sleep_for(std::chrono::milliseconds(500));
  12. }
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
Waiting...
Waiting...
Waiting...
Waiting...
Waiting...