Answer the question
In order to leave comments, you need to log in
How to wait a while in c++ and then perform some action?
To complete the task, you must wait one second and then subtract the value from the variable, looking for the answer to the question, and found only
#include <windows.h>
int main() {
Sleep(5000);
};
Answer the question
In order to leave comments, you need to log in
Use std::this_thread::sleep_for
https://en.cppreference.com/w/cpp/thread/sleep_for
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question