one or many queue timers ?
-
Hi, I have to use a timer to perform some tasks at specific intervals. The timer needs to be very accurate (+- 10 ms) and use as less CPU as possible. So I decided to use a queue timer, which seems to be the better choice. In fact, I have to trigger many events at different intervals. For exemple, I have to do something each 30 ms, another task each 120 ms and another one each 350 ms (between 1 to 25 events to trigger). What I'd like to know is which is the best solution : - using only one timer that calls only one callback procedure each 10 ms for exemple and in this procedure increments variables to know which task to process - or set up one timer with one callback procedure for each task I'd like to perform. (so it's as if I defined 25 timers but with intervalls of 30 ms, 120 ms, 350 ms ...) Thanks... Edouard
-
Hi, I have to use a timer to perform some tasks at specific intervals. The timer needs to be very accurate (+- 10 ms) and use as less CPU as possible. So I decided to use a queue timer, which seems to be the better choice. In fact, I have to trigger many events at different intervals. For exemple, I have to do something each 30 ms, another task each 120 ms and another one each 350 ms (between 1 to 25 events to trigger). What I'd like to know is which is the best solution : - using only one timer that calls only one callback procedure each 10 ms for exemple and in this procedure increments variables to know which task to process - or set up one timer with one callback procedure for each task I'd like to perform. (so it's as if I defined 25 timers but with intervalls of 30 ms, 120 ms, 350 ms ...) Thanks... Edouard
In our experience it is far better to make different timers. Pls note that queue timer do not seem to have much accuracy, better are multimedia timers (timeSetTimer) or waitable timers (CreateWaitableTimer). Regards, andrea;P
-
Hi, I have to use a timer to perform some tasks at specific intervals. The timer needs to be very accurate (+- 10 ms) and use as less CPU as possible. So I decided to use a queue timer, which seems to be the better choice. In fact, I have to trigger many events at different intervals. For exemple, I have to do something each 30 ms, another task each 120 ms and another one each 350 ms (between 1 to 25 events to trigger). What I'd like to know is which is the best solution : - using only one timer that calls only one callback procedure each 10 ms for exemple and in this procedure increments variables to know which task to process - or set up one timer with one callback procedure for each task I'd like to perform. (so it's as if I defined 25 timers but with intervalls of 30 ms, 120 ms, 350 ms ...) Thanks... Edouard
I have not designed an application that processes data in a time interval of unver 1000 ms. a time queue timer is one solution for For processs that work in the 500+ ms range. For anything shorter, I recommend a separate worker thread and WaitForSingleObject(). Kuphryn