📄 serverlog.java
字号:
package ServerImpl;
import java.io.BufferedWriter;
public class ServerLog {
private int hitcount=0,count=0,samples;
private String type;
public ServerLog(String _type,int _s){
samples = _s;
type = _type;
}
public void Record(boolean ishit){
++count;
if(ishit)++hitcount;
if(count==samples){
System.out.println(type+" Hit percent");
System.out.println("Hit Count"+hitcount+" "+ hitcount*100.0/samples+"%");
count=0;hitcount=0;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -