Constructor and Description |
---|
SecondCost() |
SecondCost(String name) |
Modifier and Type | Method and Description |
---|---|
long |
stop()
停止计时,返回计时结果
|
String |
stopAccurate()
停止计时,返回精确计时,带3小数的结果,使用ROUND_DOWN 舍弃超过3位的小数部分。
|
String |
stopAccurateAndFormat()
停止计时,并返回组装精确计时结果
|
void |
stopAccurateAndPrint()
停止计时,并打印精确计时结果
|
String |
stopAndFormat()
停止计时,并返回组装计时结果
|
void |
stopAndPrint()
停止计时,并打印计时结果
|
public SecondCost()
public SecondCost(String name)
public long stop()
Cost
public void stopAndPrint()
Cost
例如: name cost: 1000 ms, 使用System.out.println
stopAndPrint
in interface Cost
public String stopAndFormat()
Cost
例如: name cost: 1000 ms
stopAndFormat
in interface Cost
public String stopAccurate()
Cost
例如:1000.500
stopAccurate
in interface Cost
public void stopAccurateAndPrint()
Cost
例如: name cost: 1000.500 ms, 使用System.out.println
stopAccurateAndPrint
in interface Cost
public String stopAccurateAndFormat()
Cost
例如: name cost: 1000.500 ms
stopAccurateAndFormat
in interface Cost
Copyright © 2021. All rights reserved.