mirror of https://github.com/axmolengine/axmol.git
mLastTickInNanoSeconds is the renderStart
because: this.mLastTickInNanoSeconds = renderEnd - renderInterval; renderInterval = renderEnd - renderStart so: this.mLastTickInNanoSeconds = renderEnd - ( renderEnd - renderStart ); so: this.mLastTickInNanoSeconds = renderStart ; so: no need nanoTime() twice
This commit is contained in:
parent
c673955d5d
commit
3619fb943a
|
@ -100,11 +100,8 @@ public class Cocos2dxRenderer implements GLSurfaceView.Renderer {
|
||||||
/*
|
/*
|
||||||
* Render time MUST be counted in, or the FPS will slower than appointed.
|
* Render time MUST be counted in, or the FPS will slower than appointed.
|
||||||
*/
|
*/
|
||||||
final long renderStart = System.nanoTime();
|
this.mLastTickInNanoSeconds = System.nanoTime();
|
||||||
Cocos2dxRenderer.nativeRender();
|
Cocos2dxRenderer.nativeRender();
|
||||||
final long renderEnd = System.nanoTime();
|
|
||||||
final long renderInterval = renderEnd - renderStart;
|
|
||||||
this.mLastTickInNanoSeconds = renderEnd - renderInterval;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue