• 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: email@hidden
  • Date: Sat, 27 Jul 2013 00:36:04 +0900


On 2013/07/27, at 0:26, Scott Ribe <email@hidden> wrote:

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

Good point. Though this timer is pretty little and the app wouldn't be doing a lot else.
But it stands to reason that it could be battery friendly to suspend it when the app is not visible. And to offer a battery power pref to suspend when it's not the front application.

>
> 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: Steve Sisak <email@hidden>
    • Re: Observing Time
      • From: Kyle Sluder <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>)
 >Re: Observing Time (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: Observing Time
  • Next by Date: Re: Observing Time
  • Previous by thread: Re: Observing Time
  • Next by thread: Re: Observing Time
  • Index(es):
    • Date
    • Thread