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

Re: NSTimer questions


  • Subject: Re: NSTimer questions
  • From: Rustam Muginov <email@hidden>
  • Date: Wed, 22 Sep 2004 16:37:30 +0400

Where is a nice animation tutorial/article at
http://www.macdevcenter.com/pub/a/mac/2002/01/04/cocoa.html

You prolly would like to check it - it shows different approach,
singlethread and multithread for animation, and explaining the difference

On 9/22/04 4:19 PM, "Christoffer Lerno" <email@hidden> wrote:

> I'm trying to reliably tick a NSTimer to drive animation.
>
> However, on my iBook I notice I occasionally hickups.
>
> Further investigation reveals that if I set a desired fps at 60, I
> might have that drop as low as 5 fps at times. (I give you times in fps
> because it is simpler that way, 5 fps actually means the delay for that
> frame was 0.2 seconds instead of 1/60th of a second which was the
> desired delay between firing of the timer.
>
> The actual drawing isn't the problem (I timed that) - it's the timer
> which occasionally misses by as much as 200 ms.
> I am suspecting that the accuracy of the timer is very dependent on
> what's happening in the run loop (like keyboard input and the like).
>
> However I have read that putting the whole thing in a different thread
> might be to invite all sorts of pain and suffering.
> It would be tempting to move all animation and updates into a separate
> thread since it would make the game independent of interaction with
> menu-bar and the like. I'm pretty used to running threads in Java with
> the synchronizing of methods that entails, but I don't know what I need
> to watch out for when working with cocoa.
>
> Is there any way I can do screen updates safely away from the main
> thread or what path should I take? I see the load on the computer only
> ticks in at less than 10% when running the application, so there should
> be plenty to borrow from.
>
>
> /Christoffer
>
>  _______________________________________________
> 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

References: 
 >NSTimer questions (From: Christoffer Lerno <email@hidden>)

  • Prev by Date: NSTimer questions
  • Next by Date: Re: NSTimer questions
  • Previous by thread: NSTimer questions
  • Next by thread: Re: NSTimer questions
  • Index(es):
    • Date
    • Thread