wait - How use `cin` to pause the program for 10 seconds in C++ -
exacly stated in subject: how use cin wait(pause program) 10 seconds in c++. make act simiral java's thread.wait
.
edit: asking cin
that not way cin
works, has no notion of timeouts.
what want is, mentioned java, pause thread. can done in several ways...
- c++11:
std::this_thread::sleep_for(std::chrono::seconds(10));
- posix (linux et al.):
sleep(10);
- windows:
sleep(10000);
(in milliseconds)
Comments
Post a Comment