I'm looking for a way to do something every X minutes.
For example in a game you will be playing then every 3 minutes activate
foo();
but I'm not sure how to do this given that other actions will be going on. Ie, we cannot just wait 3 minutes then do foo()
instead the rest of the program must be running and the user can invoke other methods but in the background we have to be counting and getting ready to do foo()
when the time is ready.
If anyone can give me a starting point I'd much appreciate it!