On 7/11/2013 3:32 PM, K. Frank wrote:
Hello clusardi2 (and Victor)!
On Thursday, July 11, 2013 9:10:39 AM UTC-4, Victor Bazarov wrote:
On 7/11/2013 8:37 AM, clusardi wrote:
In java, they have a class where you can create a timer which will
repeatedly call a routine after a time period. Is there something
like this in C++ Visual Studio 2010?
In C++ there is no such thing, but there can be something in the library
for your platform (MS Windows, I am guessing). See 'SetTimer' Windows
API function.
Victor, or course, has answered your question -- no, not in
standard C++, but yes in the win32 api.
Having said that, it is worth noting that C++11 does introduce
the very basic functionality of being able to sleep for a
certain amount of time:
void std::this_thread::sleep_until(...)
void std::this_thread::sleep_for(...)
Prior to C++11, the standard was silent on sleep-type functions.
doesn't provide you with anything suitable.