I'm new in the world of programming, and I decided to start learning c++ on my own. There is a project i've been working in, but I'm not sure on how to make my program wait 60 seconds. Is it possible? If it is, How do I do it? PD:I'm using C++ 20. I apologize for any mistake in my writing, as I'm not a native english speaker.
Asked
Active
Viewed 74 times
0
-
4[`std::this_thread::sleep_for( 60s )`](https://en.cppreference.com/w/cpp/thread/sleep_for) – Drew Dormann May 17 '22 at 18:59
-
First and second google result for exactly your question title both give the solution. – Thomas Weller May 17 '22 at 19:01
-
Unless you still want some things to happen while only part of the program takes a 60 second break. In that case things get a lot more complicated. – user4581301 May 17 '22 at 19:02
-
What is the user doing all this time? – Paul Sanders May 17 '22 at 19:04
-
2Side note: Learning C++ on your own is often the best way to do it, but make sure you have a [good text book and library of reference materials](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list). Otherwise you're going to ask a LOT of questions and many of them won't go over all that well. – user4581301 May 17 '22 at 19:05
-
@PaulSanders: my idea: it's a clock and the text needs to update only once a minute. – Thomas Weller May 17 '22 at 19:23
-
@ThomasWeller Could be, but why are we speculating? – Paul Sanders May 17 '22 at 19:24