fps not stable on android

my phone is MeiZu M9

i just run the HelloWorld project created by the create-android-project.sh script, so all the setting values is default,

run on my phone, the fps display between 40 and 60, anyone can help me ?

Which cocos version are you using?

At some point there was a sleep command in the rendering loop that was causing a fps drop.

Look in proj.android\src\org\cocos2dx\lib\Cocos2dxRenderer.java and see if there is a sleep command in the public void onDrawFrame.

thanks Adam Reed, my version is : cocos2d-2.0-x-2.0.4 @ Nov 02 2012

and i found the sleep command in the function onDrawFrame -

Thread.sleep 2 / Cocos2dxRenderer.NANOSECONDSPERMICROSECOND);*

and after i delete the command, the fps also not stable, besides, i wonder should i delete this command before release app ?

I changed my version to * 1 rather than * 2 and it made a difference.
I don’t think my fps was a solid 60 after the change but it was at least staying over 50.

I’m not sure if you actually need the sleep or not, its something to do with keeping the fps below 60 to match the screen refresh.