• 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: NSTimer or what?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSTimer or what? (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: NSTimer or what? (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: Help with Storyboard Problem
  • Next by Date: Re: Embedded Collection View Controller scrolling issue
  • Previous by thread: Re: NSTimer or what?
  • Next by thread: Cursor outside Rect without polling
  • Index(es):
    • Date
    • Thread