android: frontend: Cleanup perf stats.

This commit is contained in:
bunnei 2019-08-30 17:16:14 -04:00
parent 55254459f0
commit 43645e3261
2 changed files with 8 additions and 5 deletions

View File

@ -18,6 +18,8 @@ import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import java.text.DecimalFormat;
import org.citra.citra_android.NativeLibrary; import org.citra.citra_android.NativeLibrary;
import org.citra.citra_android.R; import org.citra.citra_android.R;
import org.citra.citra_android.activities.EmulationActivity; import org.citra.citra_android.activities.EmulationActivity;
@ -213,12 +215,12 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
perfStatsUpdater = () -> perfStatsUpdater = () ->
{ {
final DecimalFormat df = new DecimalFormat("#.#");
double[] perfStats = NativeLibrary.GetPerfStats(); double[] perfStats = NativeLibrary.GetPerfStats();
mPerfStats mPerfStats.setText(String.format("FPS: %s Speed: %s%%", df.format(perfStats[FPS]),
.setText(String.format("FPS: %.5s\nFrametime: %.7sms\nSpeed: %.4s%%", perfStats[FPS], df.format(perfStats[SPEED] * 100.0)));
perfStats[FRAMETIME] * 1000.0, perfStats[SPEED] * 100.0));
perfStatsUpdateHandler.postDelayed(perfStatsUpdater, 3000 /* 3s */); perfStatsUpdateHandler.postDelayed(perfStatsUpdater, 2000 /* 1s */);
}; };
perfStatsUpdateHandler.post(perfStatsUpdater); perfStatsUpdateHandler.post(perfStatsUpdater);
} }

View File

@ -30,7 +30,8 @@
android:longClickable="false" android:longClickable="false"
android:shadowColor="@android:color/black" android:shadowColor="@android:color/black"
android:text="TextView" android:text="TextView"
android:textColor="@android:color/white" /> android:textColor="@android:color/holo_orange_light"
android:textSize="12sp" />
<Button <Button
android:id="@+id/done_control_config" android:id="@+id/done_control_config"