public class Timer extends Object
startTime and stopTime, to record when started and stopped respectively.| Modifier and Type | Method and Description |
|---|---|
static String |
format(long time)
Format the time into human readable style.
|
String |
name()
Get the name of timer.
|
void |
start()
Start the timer.
|
void |
stop()
Stop the timer.
|
Long |
time()
Get recorded time of a timer.
|
String |
toString() |
protected Timer(String name)
public void start()
public void stop()
public Long time()
public String name()
public static String format(long time)
The default format is HH:mm:ss.SSS
time - the timeCopyright © 2019. All rights reserved.