I need to create a timer which will call my function periodically (e.g. every 50ms). BUT the problem is I will need to change the system time while the timer is running. I would like to do this using boost so that the code is portable. Otherwise I am running it on Linux machine.
Things I have tried:
- Tried using a while loop and thread::sleep. Calculated the sleep time using steady_clock.
- Also tried using deadline_timer
Both of these stop working when the system time is adjusted.
Question: Is there any way (using boost preferably) to create a callback timer which is independent of the system time? (Bonus karma for sample code)