|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.util.Time
public class Time
A simple class for keeping track of wall-clock time. This class
also contains a utility method for converting a long
representing milliseconds to a string representation of minutes,
seconds and milliseconds.
elapsedTime(long)
Constructor Summary | |
---|---|
Time()
Creates a Time object whose start time is
System.currentTimeMillis . |
|
Time(long startTime)
Creates a Time object with the specified start time. |
Method Summary | |
---|---|
static long |
current()
An alias for System.currentTimeMillis . |
long |
elapsedMillis()
Returns the number of milliseconds since the start time of this object. |
long |
elapsedMinutes()
Returns the (floor of the) number of minutes since the start time of this object. |
static String |
elapsedTime(long elapsedMillis)
Returns a string representing the length of the specified time of the form MM:SS.mmm where MM is the number of minutes, SS is the nubmer of seconds and mmm is the number of milliseconds. |
void |
reset()
Resets the internal start time to be the current time. |
long |
startTime()
Returns the start time of this object. |
String |
toString()
Returns a string representation of the elapsed time since the start time of this Time object, using the output of
elapsedTime(long) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Time()
Time
object whose start time is
System.currentTimeMillis
.
public Time(long startTime)
Time
object with the specified start time.
Method Detail |
---|
public void reset()
public String toString()
Time
object, using the output of
elapsedTime(long)
.
toString
in class Object
public long startTime()
public long elapsedMillis()
current() - startTime()
public long elapsedMinutes()
elapsedMillis() / 60000.
public static final String elapsedTime(long elapsedMillis)
MM:SS.mmmwhere MM is the number of minutes, SS is the nubmer of seconds and mmm is the number of milliseconds.
public static final long current()
System.currentTimeMillis
.
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |