Re: [Dev-C++] Using MFC Timer Framework
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2006-06-14 22:29:11
|
You can't have events every 1 ms using the normal timers. The timer events does not stack but gets lost. Windows makes use of callbacks and messages to perform most of it's actions. The timers doesn't run in own threads. I don't know what you want to do, but windows is basically not designed to trigger actions every 1 ms. Some things - for example sound - may use hardware acceleration with buffering. One thing to look into a bit more are the multimedia timers available in Windows. They have better priority and granularity. However - don't abuse them. Make sure that the application really, really need high-speed timers before continuing with the coding! /Per W On Wed, 14 Jun 2006, Bin Zhou wrote: > Hi, > > I was just assigned to work on a MFC application using the MFC Timer > framework. Basically the application sets up several timer events. One event > is set to run every one millisecond. Because of the machine constraints, it > actually may get kicked off every 17 milliseconds if no other things > running. However, when some other operations of the application are running, > those other things may jump into the way. My questiona are: > > 1. whether each Timer event is set up to run in its own thread. > 2. if the timer triggered event takes longer to finish than the time off > value set, what will happen. Will those event be pilled up in the message > queue so that once the application gets a chance, it will go back to pick > them up. > > Thanks, > > Bin Zhou |