Does C++ has some built in timer class with same idea as .NET System.Threading.Timer
http://msdn.microsoft.com/en-us/library/system.threading.timer.aspx
Or I need to implement it myself ? :-(. Maybe there is some library , plz.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Standard C++ does not have one built in.
If you are using the
Win32API, which seems likely if you are coming from.NET, there are various options, such asSetTimer(which requires a message loop), orCreateTimerQueueTimer(which does not require a message loop).As said in the comments, most GUI frameworks will have an asynchronous timer available.
If you are looking for something more generic, or something that doesn’t require a GUI framework (like the
Win32API), you should have a look atboost::asio.