Re: question about NSTimer objects
Re: question about NSTimer objects
- Subject: Re: question about NSTimer objects
- From: Ricky Sharp <email@hidden>
- Date: Wed, 15 Mar 2006 06:57:15 -0600
On Wednesday, March 15, 2006, at 04:24AM, Karim Morsy <email@hidden> wrote:
>> How often do your timers fire? You can definitely run into problems
>> if they fire too often.
>
>-timer1 for redrawing an opengl view fires every 0.05 seconds
>-timer2 for redrawing another opengl view: every 0.05 seconds
>-timer3 for redrawing a custom nsview: every 0.02 seconds
>-timer4 for updating user information on the ui: every 0.1 seconds
>-timer5 for animating sliders fires only upon activation by the user:
>every 0.06 seconds (for approxaimately 8 seconds)
Some of these are firing at very high frequencies. I would expect you may have trouble with those firing at 0.05 and 0.02, especially on slower machines. You may end up with lots of drifting.
>do you see any problems here and if so, is there an alternative and
>better approach for what I'm doing... I know I can't use threads
>because of the thread-insafety of UI elements.
You can definitely use threads. And, in your situation, it sounds like you really should be. You'd just have to do the proper communication between the 'worker thread' and the 'main thread' to instruct the main thread to handle UI updates.
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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