Re: Elapsed time vs sleep
Re: Elapsed time vs sleep
- Subject: Re: Elapsed time vs sleep
- From: David Duncan <email@hidden>
- Date: Mon, 26 Jul 2010 09:35:48 -0700
On Jul 26, 2010, at 9:27 AM, Charlie Dickman wrote:
> As long as the NSTimer firing interval is sufficiently small the NSTimer can be used. If the run loop is stalled for any "significant: time _all_ timers will be inaccurate to some degree. The NSTimer works fine for animation and , e.g., alarm timers and they are consistent across platforms such as Mac Pros, iMacs, iPhones, etc.
At the very least if you go with the NSTimer approach, use the elapsed time between firings, rather than the assumed time of the timer's fire rate. Doing so at least reduces the drift that you will get from assuming that timers will always fire on time, every time (neither of which is true).
--
David Duncan
_______________________________________________
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