I have a C++ application that is running on the foreground. I need a timer that will run at the same time as the application. When the timer reaches zero, I need the timer to popup a window.
I can’t use sleep() because the who application sleeps. Please advice on how to do this.
Since you’re using C++11, I suggest using the
threadlibrary.What you probably want is either
std::this_thread::sleep_fororstd::this_thread::sleep_until, which can be called in the context your timer thread.Something like this…