Re: NSTimer questions
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