after scheduleUpdate, the update:(ccTime)dt will be called 60 times per second, what if at one time the update method’s running time exceeds 1/60 second? the next call will be cancelled?
after scheduleUpdate, the update:(ccTime)dt will be called 60 times per second, what if at
Share
The framerate drops. Nothing will be cancelled.
At 60 fps there’s exactly 1/60th of a second for cocos2d and your code to process everything that’s needed to render a frame, including all OpenGL drawing operations. That’s 0.016666666 seconds to do it all.
If one update cycle takes longer than that, the next frame will be rendered after 0.03333333 seconds instead, dropping the framerate to 30 fps if multiple frames continuously take longer to process. Provided that everything is done within that time, otherwise the next frame update will be deferred to 0.05 seconds or even 0.06666666 seconds.
You can only get 60, 30, 20 or 15 fps framerate with cocos2d since it uses CADisplayLink which synchronizes updates with the screen refresh rate. The framerate counter in cocos2d may show 40 fps or something because it averages over multiple frames.