Re: Observing Time
Re: Observing Time
- Subject: Re: Observing Time
- From: email@hidden
- Date: Sun, 28 Jul 2013 10:43:53 +0900
On 2013/07/28, at 8:57, Scott Ribe <email@hidden> wrote:
> On Jul 27, 2013, at 5:53 PM, email@hidden 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 think you must be doing something wrong. NSTimer should not be lagging. Post code if you want, otherwise I'm done here.
Hmm. Initially I did miss the method
initWithFireDate:interval:target:selector:userInfo:repeats:
That alone makes all the difference over the class factory methods by giving a determined start time.
But with that I still see a faint lag that seems to update just a hair slower than the dispatch timer. Noticeable to me at least, I'll post a link to the sample projects in a bit.
It's not really enough to care about but I still wonder if there is a difference.
>
>> As per the docs, NSTimer gives millisecond accuracy, but can fire some undetermined time after the set fire interval.
>
> Usually a fraction of a millisecond, never more than 100ms in my testing, and more than 10ms is rare.
>
> And again, as has been pointed out to you REPEATEDLY, if the firing of NSTimer is lagging because your main thread is busy doing something else, you're not going to be able to update your UI anyway.
Yes I get that.
>
> --
> 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