What would you say is the best way to perform an action periodically?
For instance - write to log "message1" every 0.5 seconds and "message2" every 4 seconds.
The obvious ways I could think of were:
- Make a scheduler thread that times everything itself, but I'm afraid turbohud may be in an undefined state if not accessed from a callback.
- Add my code to an existing callback that happens often, for instance "aftercollect", and check the times there, but I'm afraid it might be too inaccurate.
Is there any elegant solution I'm not aware/thinking of?