|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deckfour.xes.util.XTimer
public class XTimer
This class implements a simple timer that can be used to quickly profile the speed of operations within library components. The timer simply uses the system time for timing, and thus does not incur significant overhead on runtime.
Field Summary | |
---|---|
static long |
DAY_MILLIS
Milliseconds in one day. |
static long |
HOUR_MILLIS
Milliseconds in one hour. |
static long |
MINUTE_MILLIS
Milliseconds in one minute. |
static long |
SECOND_MILLIS
Milliseconds in one second. |
protected long |
start
Start time of timer. |
protected long |
stop
Stop time of timer. |
Constructor Summary | |
---|---|
XTimer()
Creates a new timer. |
Method Summary | |
---|---|
static String |
formatDuration(long millis)
Formats a duration in milliseconds as a pretty-print string. |
long |
getDuration()
Retrieve the runtime of the timer. |
String |
getDurationString()
Retrieve the runtime of the timer as a pretty-print string. |
void |
start()
Starts the timer. |
void |
stop()
Stops the timer (takes time). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DAY_MILLIS
public static final long HOUR_MILLIS
public static final long MINUTE_MILLIS
public static final long SECOND_MILLIS
protected long start
protected long stop
Constructor Detail |
---|
public XTimer()
Method Detail |
---|
public void start()
public void stop()
public long getDuration()
public String getDurationString()
public static String formatDuration(long millis)
millis
- Duration in milliseconds.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |