-4

I need to make program wait for some time until continue. I tried: system("stop") but console output was: " 'stop' is not recognized as an internal or external command, operable program or batch file.". I need answer in c++. Answers in Is there a decent wait function in C++? doesn't work.

Aman
  • 696
  • 1
  • 8
  • 26
jaksia
  • 11
  • 8

1 Answers1

4

Following makes your program stop. At least for the next year or so. Roughly. Bonus: Its portable and doesn't drain your laptop's battery.

#include <chrono>
#include <thread>

int main() {
  using namespace std::chrono_literals;
  std::this_thread::sleep_for(8760h);
  return 0;
}
Ben Kircher
  • 152
  • 1
  • 7