• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Elapsed time vs sleep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Elapsed time vs sleep (From: Matt Gough <email@hidden>)
 >Re: Elapsed time vs sleep (From: Charlie Dickman <email@hidden>)
 >Re: Elapsed time vs sleep (From: Kyle Sluder <email@hidden>)
 >Re: Elapsed time vs sleep (From: Charlie Dickman <email@hidden>)

  • Prev by Date: Re: Elapsed time vs sleep
  • Next by Date: Re: Elapsed time vs sleep
  • Previous by thread: Re: Elapsed time vs sleep
  • Next by thread: Re: Elapsed time vs sleep
  • Index(es):
    • Date
    • Thread