Re: Observing Time
Re: Observing Time
- Subject: Re: Observing Time
- From: Scott Ribe <email@hidden>
- Date: Sat, 27 Jul 2013 11:00:11 -0600
On Jul 27, 2013, at 10:16 AM, email@hidden wrote:
> Why would I add to slowing down the main thread when I can run a dispatch_timer on another thread and get the timer to fire more reliably?
> That doesn't make sense.
What's going to slow down the main thread??? Certainly not an NSTimer firing once a second. Hopefully not the calculations involved in drawing a clock--and if that were the case, then yes that might need to be moved to another thread. Hopefully not the actual drawing, since moving that to another thread complicates things with drawing to offscreen and then flushing from the main thread.
> In trying to keep a slim and trim main thread to keep steady movement.
> NSTimer is not for everything and does not give as much accuracy.
It probably gives way more than enough accuracy to keep steady movement, unless your main thread is bogged down--but in that case all you achieve with your complexity is calculating & possibly drawing on time in a background thread, and then waiting for the main thread to update the display: in other words you probably achieve absolutely nothing.
It seems to me that you're complicating your life by anticipating and working around problems that simply don't exist, with complexity that probably wouldn't solve the problems even if they did exist.
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden