Re: NSTimer causes events to be lost
Re: NSTimer causes events to be lost
- Subject: Re: NSTimer causes events to be lost
- From: "John C. Randolph" <email@hidden>
- Date: Fri, 18 Mar 2005 14:17:34 -0800
On Mar 18, 2005, at 1:51 PM, John Pattenden wrote:
I have an NSTimer I need to fire about every 1/500th of a second -
but if I do I start to lose some events - or things that happened
automatically become unreliable.
A good example is window activation and deactivation. If I slow my
timer down that all works fine, but now the animation I am running
starts to drop frames.
is there a good solution to problems like this, I'm thinking a
thread would be problematic since I am drawing in my timer call..
its not clear to me that my code is taking longer than 1/500th of
a second to execute, so I don't think that is the problem..
shouldn't these events just be getting queued rather then chewed?
Is there a way to get some time each time the run loop executes
kind of like dare I say it WaitNextEvent?
John,
If you need to make things happen on a hard real-time schedule, you
should be using something like the Quicktime API. NSTimer's purpose
is to implement things like cursor flashing and progress-bar animation.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden