John Sutton escribió:
Oswaldo said;
Tanks John, but AlmSetAlarm works in seconds, i need more precision, preferably
miliseconds.
Oswaldo,
Sorry, but you didn't say you needed it that accurate.
You'll have to do it in your event loop, instead of using EvtGetEvent() with
waitforever.
You can call it with a timeout in ticks, it will generate a nilEvent if there
are no other events to despatch.
Respond to the nilEvent by calling TimGetTicks, and comparing it to the last
time you were called with a nilEvent.
The smaller the number you set in the timeout in EvtGetEvent the more accurate
you can do timings, but remember, the more you get called with nilEvents using
this method, the more battery power you use up, so set it to the largest value
that can still give you the accuracy you need.
That's how we do it with animation in one of our projects.
Hope that makes sense.
Cheers
John
I had thought about these solution yet. I already have a EvtGetEvent each 5 ticks because use nil
events for anhoter things.
The question was about I have missesd that palmos do not have any timer function with better
accuracy than AlmSetAlarm.
Thanks John and Neil for your replies.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Oswaldo Hernández
Sent: 16 November 2006 12:58
To: Palm Developer Forum
Subject: Re: Timer
John Sutton escribió:
Oswaldo,
Read up on the alarm manager, the function you'll want is AlmSetAlarm
Regards John
Tanks John, but AlmSetAlarm works in seconds, i need more precision, preferably
miliseconds.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Oswaldo
Hernández
Sent: 16 November 2006 11:09
To: Palm Developer Forum
Subject: Timer
Hello,
I'm searching for a timer function and i don't find it.
I need a simple function that register a timer and, when the time expire, send
and event or execute a callback.
Exists it? or, may i create my own timer function using the main loop?
--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/