> On 20 Jun 2017, at 16:24, Alastair Houghton <[email protected]> 
> wrote:
> 
> On 20 Jun 2017, at 04:04, Gerriet M. Denkmann <[email protected]> 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 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