public class SpeedEvent extends Object
限定符和类型 | 字段和说明 |
---|---|
private int |
count |
private long |
currentTime |
private Map<String,Object> |
datas |
private String |
name |
private long |
runTime |
private long |
startTime |
private String |
threadName |
构造器和说明 |
---|
SpeedEvent(String name,
long startTime)
实例化,通过计速器名称和开始时间
|
限定符和类型 | 方法和说明 |
---|---|
void |
addData(String name,
Object obj)
data添加一条记录
|
int |
getCount()
取得记录数
|
long |
getCurrentTime()
取得当前时间,当前时间即在endStart被调用的时间,毫秒单位
|
Object |
getData(String name)
取得data数据,如果有其他数据在这里没有明确定义,可以添加到data中进行记录
|
String |
getName()
取得计速器名称
|
long |
getRunTime()
取得运行时间
|
String |
getThreadName()
取得当前线程名称
|
void |
setCount(int count)
设置记录数
|
void |
setEndTime(long endTime)
设置结束时间,计算运行时间
|
private final String name
private final long startTime
private long runTime
private long currentTime
private String threadName
private int count
public SpeedEvent(String name, long startTime)
name
- 计速器名称startTime
- 开始时间public void setEndTime(long endTime)
endTime
- 结束时间public int getCount()
public void setCount(int count)
count
- 记录数public String getName()
public long getRunTime()
public long getCurrentTime()
public Object getData(String name)
name
- 记录名称public String getThreadName()
Copyright © 2020. All rights reserved.