robertcc
January 22nd, 2008, 11:48 AM
I have a C++ program which needs to execute some code on a regular, timed, basis. A timer interval of 20 ms would be typical.
I have been reading about timer queue functions and it seems like this is what I should use. However, from what I have read so far, it sounds like the callback function would be called every 20 ms even if the previous call to the callback function was not finished.
Is there any way to prevent this? I only want the callback function called if the previous call to this function has finished. If it hasn't, the timer event should be ignored until the next time around.
I have been reading about timer queue functions and it seems like this is what I should use. However, from what I have read so far, it sounds like the callback function would be called every 20 ms even if the previous call to the callback function was not finished.
Is there any way to prevent this? I only want the callback function called if the previous call to this function has finished. If it hasn't, the timer event should be ignored until the next time around.