Re: NSTimer or what?
Re: NSTimer or what?
- Subject: Re: NSTimer or what?
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 20 Jun 2017 22:00:48 +0700
> On 20 Jun 2017, at 16:24, Alastair Houghton <email@hidden>
> wrote:
>
> On 20 Jun 2017, at 04:04, Gerriet M. Denkmann <email@hidden> wrote:
>>
>
>> 2. some other thing repeatedly about every 0.1 second.
>
> Personally, I’d choose an API that directly supports repeating timers, so I’d
> prefer NSTimer or CFRunLoopTimer over the other options, all else being
> equal.
I have just tested dispatch_after() versus NSTimer and it turns out that you
were right: NSTimer is the better choice.
The dispatch_after version takes about 6 % more Cpu time, compared to the
NSTimer version.
Also the NSTimer version takes less code. Better on both counts.
Kind regards,
Gerriet.
_______________________________________________
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