At 10:14 AM -0500 2001/08/23, Jeff Ondich wrote:
>How do I go about setting a timer for, say, half a second?

Use the timeout parameter of EvtGetEvent.


>The Alarm Manager seems to have a minimum resolution of one second.

Correct. And when the device is off, it's only accurate to about a minute.


>EvtSetNullEventTick seems like an unreliable way to do timing.  Also, I
>don't see a way to distinguish a nilEvent generated by EvtSetNullEventTick
>and any other nilEvent the system might generate.  Actually, I'm not very
>clear on the nature of nilEvents in general.
>
>Posting my own "I'm still waiting" events repeatedly to the queue until
>TimGetTicks is big enough seems inefficient.

Why post events to the queue? Just compute the timeout parameter. Every time 
EvtGetEvent returns, check the current tickcount to see if it's really time for your 
code to run (because there may have been some other reason you received a null event). 
This topic has been covered dozens of times... check the archives and knowledgebase 
for more info.

Regards,

Jim Schram
Palm Incorporated
Partner Engineering


-- 
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