Re: Lots of NSTimers?
Re: Lots of NSTimers?
- Subject: Re: Lots of NSTimers?
- From: Greg Titus <email@hidden>
- Date: Fri, 20 May 2005 16:56:04 -0700
On 5/20/05, Karl Goiser <email@hidden> wrote:
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?)
Hi Karl,
I can't answer your question about the implementation of NSTimer, but
if you do end up needing a time-sorted queue with a single timer for
the next event, you could check out OFScheduler in OmniFoundation,
which is exactly this. We wrote it because we needed an easy/efficient
way to group a bunch of events and cancel and reschedule them all at
once.
Hope this helps,
- Greg
_______________________________________________
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