Back to project page game-api-android.
The source code is released under:
MIT License
If you think the Android project game-api-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package android.gameengine.icadroids.engine; //from ww w . j a va 2 s.c o m /** * Utility to log the FPS (frames per second) of the Game. * To use the FPS logger, set USE_FPS_COUNTER to 'true' in the GameEngine. * * @author Edward * */ public class GameFPSCounter { long startTime = System.nanoTime(); int frames = 0; public static boolean USE_FPS_COUNTER = false; public void logFrame(String name) { if (USE_FPS_COUNTER) { frames++; if (System.nanoTime() - startTime >= 1000000000) { //Log.d(name + " FPS:", "" + frames + " FPS!"); frames = 0; startTime = System.nanoTime(); } } } }