Back to project page tetris-android.
The source code is released under:
MIT License
If you think the Android project tetris-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 com.badlogic.androidgames.framework.helper; //www . ja va 2s . c o m import android.util.Log; public class FPSCounter { long startTime = System.nanoTime(); int frames = 0; public void logFrame() { frames++; if(System.nanoTime() - startTime >= 1000000000) { Log.d("FPSCounter", "fps: " + frames); frames = 0; startTime = System.nanoTime(); } } }