Steve Austin <[EMAIL PROTECTED]> wrote in message
news:12611@palm-dev-forum...
Here's a $.02 solution
In the eventloop you COULD pass all kinds of nil events or just send them
at an interval...
EvtGetEvent(&event, sysTicksPerSecond/2); // Loop until 1/2 second passes
for TIME
And just have an updater that responds
(to either nil events or others...)
it's not the event that matters it's running thru' the eventloop
that does. Add a time handler that always returns false.
so at EVERY event the time gets updated. the above
just sends a nil event at 1/2 sec. Accuracy is just
a matter of tossing events into the event loop.
YOU CAN have accuracy to a 100th of a second
if you don't limit the GetEvent to event recieved
and let all the nil events roll but you can't display
it reasonably but to the 10th displays perfectly
Slam me on accuracy all you want just rember
that TIME is man's creation anyway. We're
ALWAYS living in the past by a clock...
Since you only get 100 ticks per second
that seems to be the device limit. I used
to normalize against SysTicksPerSecond()
but even a dead battery gave 100 as the
result. So there's you're accuracy...
>
> Hello everyone,
>
> I'm sure someone has done this before, so I figured I"d ask for advice. I
> need to display a "ticking" timer and I'm wondering about event frequency.
> I know how to send events, and I know how to handle the screen, but how do
I
> get an event to process every second. It seems like if I was going to
write
> code to do this I'd end up filling the message queue with timer messages,
> and most of the time the timer code would just exit, until a second
actually
> passed. This kind of timer would use up 100% CPU time, and make it
> difficult to process user input (like clicking a button that closed the
> form). What's the "right" way to go about this....
>
> Thanks,
>
> Steve
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/