• 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: Christoffer Lerno <email@hidden>
  • Date: Thu, 23 Sep 2004 10:31:27 +0200

On Sep 23, 2004, at 03:11, Daniel Todd Currie wrote:

A quick solution is to base your animation cycle on a timer, but actually update the drawing based on the clock time, rather than the timer. That way, if a timer takes twice as long as expected to fire, your drawing will essentially skip a frame and stay on schedule (which it should probably do anyway, if the run loop is so bogged down that the timer is late).

There is no bogged down run loop. The reason there is a skip is because the timer is inprecise.


Skipping a frame because the computer is busy is ok, skipping a frame because of inaccurate timing isn't.

I also checked out the OpenGL demos in the Examples folder. I read elsewhere that they use a 1000fps timer just to make.

And guess what? They also have occasional frame drops when the fps goes down to 20-30 and this IS visible.

I'm trying to track it down exactly because I keep seeing it and it is annoying. It makes things look like the computer is too slow to render, when in fact the render takes less than a millisecond and the delay is from the thread sleeping waaay too long.

Frame skipping (even with interpolation) is just not acceptable unless it's because the computer is too slow to render.


/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


References: 
 >NSTimer questions (From: Christoffer Lerno <email@hidden>)
 >Re: NSTimer questions (From: Daniel Todd Currie <email@hidden>)

  • Prev by Date: Re: Moving objects with the mouse
  • Next by Date: Re: NSTimer questions
  • Previous by thread: Re: NSTimer questions
  • Next by thread: Re: Newbie question: how to release an object that has been autoreleased
  • Index(es):
    • Date
    • Thread