I have had problems with using nil events as pose creates extra nil events
causing problems, my method appears to work fine so far.

Rik

> -----Original Message-----
> From: HowY [SMTP:[EMAIL PROTECTED]]
> Sent: 08 August 2000 15:10
> To:   Palm Developer Forum
> Subject:      Re: Creating a non accurate 1 second timer
> 
> Hi Richard
> 
> > I dont like any of the methods ive seen. What I want is my own event (ie
> a
> > user event "myEvent") to go off approximatly every second.
> 
> Well a suggestion from this little head may help...
> 
> Firstly you'll HAVE to fire off a nil event as a means of sending out
> your custom event.  In the event loop do a wait on systickspersecond
> and divide it out.  Since it's generically a value of 100 divide it by
> half or a quarter and every half a second you'll get a nilevent.
> 
> Now when processing your nil test the time and if you have a
> non accurate 1 second,  fire your custom and act upon it in another
> fashon.
> 
> > I have a method that posts an event in the call to EvtGetEvent if a
> second
> > has passed since my last event. However my method requires me to return
> > a value other that evtWaitForever to work, as there does not seem to be
> enough
> > system events to keep it happy.
> 
> you get a MAXIMUM of 100 events per second provided you do little except
> return true to snach the next event.  or 0 events if its set to
> evtWaitForever
> 
> >  Much less than one a second, which supprises me.
> 
> I wrote an accurate clock that works & displays 100ths by systick!
> 
> > The following function is called in EvtGetEvent, you can use TimGetTicks
> > instead of seconds to get different granualarity, but I only want aprox
> > every second so this works fine after the first events
> 
> The actual tick value depends on the processing you do upon the event
> but you're missing the easy ways. 1) use the event loop and fire your
> custom
> event by it.  as in ! MyCustomHandler   before any other handlers and test
> if it's a nilevent if so send your event.  Of course set the timeout in
> getevent
> 2) use the nilevent given to you to run the timer...
> 
> > Being a big head, I reckon this method is the best Ive seen (becuase I
> > thought of it myself). If anyone can see any problems with it or know a
> > better way please let me know.
> 
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/

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