|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.rwth.utils.Stopwatch
This class implements a stop watch which measures the elapsed time in milliseconds.
Field Summary | |
protected java.lang.String |
desc
The descriptive text of this stopwatch. |
protected long |
splitStartMillis
The time where the last split was started (in milliseconds). |
protected boolean |
started
true iff the stop watch was started more often than
stopped. |
protected long |
startMillis
The time where the stop watch was started (in milliseconds). |
protected java.util.Vector |
timings
The accumulated timings. |
Constructor Summary | |
Stopwatch()
Creates a new stop watch w/o descriptive text. |
|
Stopwatch(java.lang.String desc)
Creates a new stop watch with descriptive text. |
Method Summary | |
java.util.Vector |
get()
Returns the accumulated result after the watch was stopped. |
java.lang.String |
getDescription()
Returns the descriptive text used when creating the stop watch plus. |
static void |
main(java.lang.String[] args)
Mini test environment. |
void |
reset()
|
void |
reset(java.lang.String desc)
Resets this stopwatch to its initial state. |
void |
split()
Starts a new segment in the stopped time w/o descriptive text. |
void |
split(java.lang.String s)
Starts a new segment in the stopped time with descriptive text. |
void |
start()
Starts the stop watch w/o a start text. |
void |
start(java.lang.String s)
Starts the stop watch with a start text. |
void |
stop()
Stops the stop watch and returns the accumulated result. |
void |
stop(java.lang.String s)
Stops the stop watch and returns the accumulated result. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Vector timings
protected java.lang.String desc
protected long startMillis
protected long splitStartMillis
protected boolean started
true
iff the stop watch was started more often than
stopped.Constructor Detail |
public Stopwatch(java.lang.String desc)
desc
- a value of type String
public Stopwatch()
Method Detail |
public java.lang.String getDescription()
null
this method return the empty string. If it was
neither null nor empty, it returns the descriptive text plus space appended.String
valuepublic void start(java.lang.String s)
s
- a value of type String
public void start()
nil
- a value of type
public void split(java.lang.String s)
s
- a value of type String
public void split()
public void stop(java.lang.String s)
s
- The descriptive text of the last segmentpublic void stop()
public void reset(java.lang.String desc)
desc
- a String
valuepublic void reset()
public java.util.Vector get()
Vector
valuepublic java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
args
- a String[]
value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |