[C++] Run function every 30 seconds

So basically, i need to make a function that will be activate every 30 seconds,
but the trick is that i want it every 30 seconds in a minute so like
07 : 58 : 00
07 : 58 : 30
07 : 59 : 00
07 : 59 : 30

i think that it depend when the application is started
so if its started in 07 : 58 : 09
if i put it to call it every 30 seconds it will go like this
07 : 58 : 09
07 : 58 : 39
07 : 59 : 09
07 : 59 : 39

or if its started in 07 : 58 : 15

07 : 58 : 15
07 : 58 : 45
07 : 59 : 15
07 : 59 : 45

I don't want it to be dependent when the application starts. Thanks :)

So basicaly i need to run a function every time the time of the seconds is 30
Last edited on

You need to be looking at creating a thread.

http://www.cplusplus.com/reference/thread/thread/
Topic archived. No new replies allowed.