i need help, im new to programming

i need timer functions to do stuff like:


i want the timer to repeat it self every 2 hours,
i want a thing to happen every 2 hours,

sorry for my poor english, and thank you all
Are you using c++11? 'cause if you do just look round #include <chrono> , else just use the sleep function with a damn huge number.. (not sure if its the safe way --')
thanks bro Paul Combaldieu .. im trying to learn more about chrno lib ..
std::chrono can be tough to get used to. I've only used it for performance monitoring myself but, I suppose you might be able to hack together some stuff with duration objects to suit your purposes... but 2 hours is a very long time. I'm curious as to the application.

Here's this site's chrono reference:

And here's a tutorial of duration objects:

a little dated, as paul combaldieu mentioned with C++11 chrono is now in the stl.

Sleep does something funky with threads and may not work if you are multi-threaded... As this other post mentions:

Last edited on
thanks all, I appreciate your raplay
Topic archived. No new replies allowed.