📜  java opengl 获取 fps - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:43.108000             🧑  作者: Mango

代码示例1
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();
        }
    }