com.inxar.syntacs.util
Class Clock
java.lang.Object
|
+--com.inxar.syntacs.util.Clock
- public class Clock
- extends Object
A Clock
is a simple utility class used for timing
things, like a stopwatch. Use it wherever you would use
System.currentTimeMillis()
for timing runtime
performance and such.
Constructor Summary |
Clock()
Makes a new Clock and marks the current time. |
Method Summary |
long |
elapsed()
Computes the interval between the current time and the last
mark but does not reset the mark. |
long |
lap()
Computes the interval between the current time and the last
mark and sets the mark to the current time (resets the
Clock ). |
void |
reset()
Sets the mark to the current time. |
long |
time()
|
Clock
public Clock()
- Makes a new
Clock
and marks the current time.
reset
public void reset()
- Sets the mark to the current time.
lap
public long lap()
- Computes the interval between the current time and the last
mark and sets the mark to the current time (resets the
Clock
).
elapsed
public long elapsed()
- Computes the interval between the current time and the last
mark but does not reset the mark.
time
public long time()