Re: Lots of NSTimers?
Re: Lots of NSTimers?
- Subject: Re: Lots of NSTimers?
- From: Bob Ippolito <email@hidden>
- Date: Fri, 20 May 2005 19:31:49 -0400
Look at the implementation of CFRunLoopTimerRef and see if its
implementation suits your use case. I'd have to imagine it's either
toll-free bridged to NSTimer, or NSTimer is implemented in terms of
CFRunLoopTimerRef, but I'm too lazy to look it up.
-bob
On May 20, 2005, at 7:24 PM, Karl Goiser wrote:
(Well, I thought it was obvious, but that's probably because I am
inside the thing, so sorry..)
Imagine an array of objects (which could number in the hundreds, or
thousands) that need to be updated "some time in the future". The
times vary, but the period for many is the same.
The question is whether to fire an NSTimer for each of those
objects, or to build a 'callout'-style queue where the objects are
sorted according to next firing time so only the head of the queue
ever needs to be checked for firing...
On 21/05/2005, at 8:58 AM, The Karl Adam wrote:
It would help if you told us what your trying to do instead of how
your trying to do it.
-Karl
On 5/20/05, Karl Goiser <email@hidden> wrote: G'Day,
I have a requirement which involves (potentially) hundreds of
independent NSTimer-style one-shot events.
Could anybody advise as to whether it would be better to use
(hundreds of) NSTimers, or build a lightweight version with a time-
sorted queue and one NSTimer for the next event?
(I guess this has to do with the internal implementation of NSTimer -
are they all checked every time through the event loop, or is a
callout queue used?)
Thanks in advance!!
Karl
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list ( email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden