|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.knowceans.util.StopWatch
public class StopWatch
StopWatch allows to time a java program by simply starting lap-timing, stopping and resetting a stop watch "channel".
Method Summary | |
---|---|
static StopWatch |
clear()
Reset the default named stop watch. |
static StopWatch |
clear(java.lang.String watch)
Removes the named stop watch, i.e., gets rid of the data and entry in the watches table. |
java.lang.String |
debug()
Prints a debug string |
static java.lang.String |
digits(long number,
int digits)
zero-pad the number on the left to create a string of digits characters. |
static java.lang.String |
format(long reltime)
Format a long time string into hh.mm.ss etc. |
static StopWatch |
get()
Get the default watch object. |
static StopWatch |
get(java.lang.String watch)
Get the named watch object. |
java.util.Vector<java.lang.Long> |
getLaps()
|
java.lang.String |
getName()
|
static java.util.Hashtable<java.lang.String,StopWatch> |
getWatches()
Get all watches as a table (can be used to add or remove certain watches). |
static long |
lap()
Get the time of the default watch, relative to the last call to lap. |
static long |
lap(java.lang.String watch)
Get the time of the named stop watch, relative to the last call to lap or start, whatever was later. |
static void |
main(java.lang.String[] args)
|
static void |
print()
Print toString() of the default watch to stdout. |
static void |
print(java.lang.String watch)
Print toString() to stdout. |
static long |
read()
Read the current time the default watch is showing. |
static long |
read(java.lang.String watch)
Read the current time the named watch is showing. |
static long |
start()
Start the default stop watch. |
static long |
start(java.lang.String watch)
Starts the named watch. |
static long |
stop()
Get the stopping time of the default watch and reset it. |
static long |
stop(java.lang.String watch)
Get the stopping time of the named watch and reset it. |
java.lang.String |
toString()
Prints the status of this stop watch, i.e., its name and current reading. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.lang.InterruptedException
java.lang.InterruptedException
public static long start(java.lang.String watch)
watch
- string identifier for that watch.
public static long start()
public static StopWatch clear(java.lang.String watch)
watch
- public static StopWatch clear()
public static StopWatch get(java.lang.String watch)
watch
-
public static StopWatch get()
watch
-
public static long lap(java.lang.String watch)
watch
-
public static long lap()
public static long read(java.lang.String watch)
watch
-
public static long read()
public static long stop(java.lang.String watch)
watch
-
public static long stop()
public java.lang.String debug()
public java.lang.String toString()
toString
in class java.lang.Object
public static void print(java.lang.String watch)
watch
- public static void print()
watch
- public static java.lang.String format(long reltime)
reltime
-
public static java.lang.String digits(long number, int digits)
number
- digits
-
public static final java.util.Hashtable<java.lang.String,StopWatch> getWatches()
public final java.lang.String getName()
public final java.util.Vector<java.lang.Long> getLaps()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |