Android Open Source - AndroidLapTimer F P S Counter






From Project

Back to project page AndroidLapTimer.

License

The source code is released under:

MIT License

If you think the Android project AndroidLapTimer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.pimentoso.android.laptimer;
//from w ww. j  a va 2 s  .  c  o m
import android.util.Log;

public class FPSCounter {

    private int frames = 0;
    private int fps = 0;
    private long startTime = System.nanoTime();
  private StringBuilder sb = new StringBuilder();
    
    public void update() {
        frames++;
        if(System.nanoTime() - startTime >= 1000000000) {
          fps = frames;
            frames = 0;
            startTime = System.nanoTime();
          Log.d("Mini4WD Lap Timer FPS", printFrames());
        }
    }

  public String printFrames() {
    sb.setLength(0);
    sb.append("fps: ").append(fps);
    return sb.toString();
  }
}




Java Source Code List

com.pimentoso.android.laptimer.DefaultPreferences.java
com.pimentoso.android.laptimer.FPSCounter.java
com.pimentoso.android.laptimer.LapListAdapter.java
com.pimentoso.android.laptimer.SensitivityDialogActivity.java
com.pimentoso.android.laptimer.TimerActivity.java
com.pimentoso.android.laptimer.Utils.java