• 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: perform ... afterDelay?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: perform ... afterDelay?


  • Subject: Re: perform ... afterDelay?
  • From: Nathan Day <email@hidden>
  • Date: Thu, 5 Jan 2006 17:28:34 +1100

have you measured the overhead or are you having a problem with the overhead, if not what are you trying to fix. [self performSelector:@selector(someSelector) withObject:nil afterDelay: 0.04] might use a NSTimer anyway, if memory servers correctly the GNU step does this using NSTimers, NSRunLoop keep a collection of NSTimers to keep track on time events. If timing is critical then maybe you should be using a thread since the timing is going to be screwed up if the NSRunLoop has called something else that has not returned in time to fire you timer, like handling user input.

On 05/01/2006, at 1:06 AM, goessly wrote:

I need to increment a counter after a short wait, like this:

while(myCounter < maxCounter)
{
	do Stuff;
	wait 0.04 seconds;
	increment myCounter;
}

In this lists' archives I found the hint to use the following; instead of having to bother with an NSTimers' overhead:
[self performSelector:@selector(someSelector) withObject:nil afterDelay:0.04]


Simplisticly put: (how) can I use that like this:
[self myCounter++  afterDelay:0.04]

kind regards,
goessly
_______________________________________________
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
  • Follow-Ups:
    • Re: perform ... afterDelay?
      • From: Marco Scheurer <email@hidden>
References: 
 >perform ... afterDelay? (From: goessly <email@hidden>)

  • Prev by Date: Re: Breakpoints in categories are ignored?
  • Next by Date: sorting with nstreecontroller
  • Previous by thread: Re: perform ... afterDelay? [solved]
  • Next by thread: Re: perform ... afterDelay?
  • Index(es):
    • Date
    • Thread