On Jul 27, 2013, at 7:53 PM, [email protected] wrote:
> I just tried both approaches and guess which one stays right there with the 
> menu bar clock and which one lags?
> dispatch timer is the winner. 
> And it's not doing a lot. 
> 
> I built a test app for each approach to verify.

Is it possible there's a difference in how you're doing the math in the two 
cases, such that the NSTimer case might be firing *early* rather than late?  
Say the first NSTimer fires a little before the time you intended -- for 
example, it fires at 00:36.9999 instead of 00:37.  Your UI will not get around 
to displaying the 37 until possibly a whole second later, depending on how you 
set up the firing of the next timer.

If I were using an NSTimer approach I might set it to fire at .001 past the 
second just to be sure I don't get caught by rounding error in my 
floating-point math.

--Andy


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to