| java.lang.Object jimm.util.StopWatch
StopWatch | public class StopWatch (Code) | | Prints time durations; used for development purposes only.
No threads or system resources are harmed in the making of a stop watch. A
stop watch simply remembers the start time (and elapsed time when paused)
and prints the total "running" time when either
StopWatch.mark or
StopWatch.stop is called.
StopWatch.stop doesn't really stop anything. You can call stop as many times
as you like and it will print the time elapsed since start. It would be
easy to change this behavior, but I haven't needed to.
author: Jim Menard, jimm@io.com |
Method Summary | |
public void | mark() Prints the current elapsed time without stopping. | public void | mark(boolean printMark) Prints the current elapsed time without stopping, along with the
stop watch name if printMark is true . | public void | mark(String msg) Prints the current elapsed time without stopping, along with the
stop watch name and msg. | public void | mark(String msg, boolean printMark) Prints the current elapsed time without stopping, along with, along with
the stop watch name if printMark is true and the
msg if it's not null . | public void | pause() Pauses the stop watch. | public void | resume() Resumes the stop watch. | public void | start() Remembers the current time and prints a message. | public void | start(boolean printStarting) Remembers the current time and prints a message if requested. | public void | stop() Stops the stop watch and prints the name of this stop watch and the current
elapsed time. | public void | stop(String msg) Stops the stop watch and prints the name of this stop watch,
msg if non-null , and the current elapsed time. | public void | stop(String msg, boolean printName) Prints the current elapsed time, along with the stop watch name if
printMark is true and the msg if it's
not null . |
elapsedTime | protected long elapsedTime(Code) | | |
StopWatch | public StopWatch()(Code) | | |
mark | public void mark()(Code) | | Prints the current elapsed time without stopping.
|
mark | public void mark(boolean printMark)(Code) | | Prints the current elapsed time without stopping, along with the
stop watch name if printMark is true .
Parameters: printMark - if true , the stop watch name willbe printed |
mark | public void mark(String msg)(Code) | | Prints the current elapsed time without stopping, along with the
stop watch name and msg.
Parameters: msg - a message to print |
mark | public void mark(String msg, boolean printMark)(Code) | | Prints the current elapsed time without stopping, along with, along with
the stop watch name if printMark is true and the
msg if it's not null .
Parameters: msg - a message to print Parameters: printMark - if true , the stop watch name willbe printed |
pause | public void pause()(Code) | | Pauses the stop watch.
|
resume | public void resume()(Code) | | Resumes the stop watch.
|
start | public void start()(Code) | | Remembers the current time and prints a message.
|
start | public void start(boolean printStarting)(Code) | | Remembers the current time and prints a message if requested.
Parameters: printStarting - if true and this stop watch has aname, print a message |
stop | public void stop()(Code) | | Stops the stop watch and prints the name of this stop watch and the current
elapsed time.
|
stop | public void stop(String msg)(Code) | | Stops the stop watch and prints the name of this stop watch,
msg if non-null , and the current elapsed time.
Parameters: msg - a message to print; may be null |
stop | public void stop(String msg, boolean printName)(Code) | | Prints the current elapsed time, along with the stop watch name if
printMark is true and the msg if it's
not null .
Parameters: msg - a message to print; may be null Parameters: printName - if true , the stop watch name willbe printed |
|
|