📄 fps.java
字号:
/*
* class used to obtain frame rate
*/
public class FPS {
public static int fps = 10;
private int count_fps;
private String fps_string;
private long last;
public FPS() {
fps = 10;
count_fps = 0;
}
public void calculateFps() {
count_fps++;
long n = System.currentTimeMillis() / 1000L;
if (n != last) {
fps = count_fps;
count_fps = 0;
fps_string = "Fps:" + fps;
last = n;
}
}
public String getFpsString() {
return fps_string;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -