• 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: Observing Time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Observing Time


  • Subject: Re: Observing Time
  • From: Scott Ribe <email@hidden>
  • Date: Fri, 26 Jul 2013 09:26:34 -0600

On Jul 26, 2013, at 8:13 AM, Steve Sisak <email@hidden> wrote:

> It's worth noting that's very energy inefficient.
>
> Once the WWDC sessions are back on line, watch
> the energy efficiency sessions to see what's
> happening with timers in Mavericks.

Yes. The only place I've deployed constantly-firing timer code is on a server that runs 24/7, and in a particular full-screen mode that the user only enters for a short time.

> For what the OP is doing, using NSTimer on the
> main event loop with an offset would be a good
> implementation -- it might take adjusting the
> offset to get the timer to fire a little early
> and/or accomodate the actual fire time in the
> code.

Personally, I'd probably just do a non-repeating timer, set to fire at the next second roll-over. Alloc'ing, scheduling and releasing 1 timer per second is not a lot of overhead.

--
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


  • Follow-Ups:
    • Re: Observing Time
      • From: email@hidden
References: 
 >Observing Time (From: email@hidden)
 >Re: Observing Time (From: Rick Mann <email@hidden>)
 >Re: Observing Time (From: email@hidden)
 >Re: Observing Time (From: Ken Thomases <email@hidden>)
 >Re: Observing Time (From: email@hidden)
 >Re: Observing Time (From: Ken Thomases <email@hidden>)
 >Re: Observing Time (From: Scott Ribe <email@hidden>)
 >Re: Observing Time (From: Steve Sisak <email@hidden>)

  • Prev by Date: Re: Leak when "drawing too fast"
  • Next by Date: Re: Observing Time
  • Previous by thread: Re: Observing Time
  • Next by thread: Re: Observing Time
  • Index(es):
    • Date
    • Thread