I sent the following message Sunday afternoon. As it was not returned in
the digest, I assume it got lost in the ether. So here it is again.
Apologies if you already received this.

2001/06/02

Dear Listers

I need to execute a function exactly once a second on the 
second. 

I dreamed up the following scheme which appears to function, 
except for occassonal bursts of timing jitter of a few ticks 
which could be a problem: 

static void EventLoop(void)
{ 
   the usual stuff
   .
   .
   timeout = 75;          //ticks = 750mS
  
do
 {
   EvtGetEvent (&event,timeout);
   if ......
    if ......
     if ......
   if (event is not premature);
     {
       poll until seconds counter changes value;
       retrieve and display current ticks;    // for testing only
       do my stuff;     // not included in test program
      }
    calculate new timeout;
   }
 while .... ;
}

Can anyone suggest a more elegant and/or possibly more precise 
solution? 

Please accept my thanks in advance for any help/suggestions.

sincerely
Herb Valliant      





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to