|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.globus.cog.util.timer.StopWatch
A stopwatch to measure time.
| Field Summary | |
static long[] |
timer
|
static String[] |
timerName
|
| Constructor Summary | |
StopWatch(int n)
Creates a new StopWatch instance. |
|
| Method Summary | |
void |
add(int i,
long time)
The add method add the time to the timer i. |
void |
add(String name,
long time)
The add method add the time to timer "name". |
long |
get(int i)
The get method gets the value of the timer
with the given name check. |
int |
getIndex(String name)
The getIndex method gets the index of the
timer with the given name |
void |
init(int n)
The init method creates n timers each timer has a
default name "Time i" where i is a number between 1 and n. |
void |
pause(int i)
The pause method pause the ith timer. |
void |
printTimer(int i)
The printTimer method prints the ith timer result
in seconds. |
void |
printTimer(String name)
The printTimer method prints the ith timer result. |
void |
printTimers()
Describe printTimers method prints all timer results. |
void |
reset(int i)
The reset method resets the timer. |
void |
resume(int i)
The resume method resumes the ith timer. |
void |
set(int i,
String name)
The set method sets the name of the ith timer. |
int |
size()
The size method returns the number of timers. |
void |
start(int i)
The start method starts the ith timer. |
void |
stop(int i)
The stop method stops the ith timer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static long[] timer
public static String[] timerName
| Constructor Detail |
public StopWatch(int n)
StopWatch instance.
n - an int value| Method Detail |
public void init(int n)
init method creates n timers each timer has a
default name "Time i" where i is a number between 1 and n.
n - an int valuepublic void reset(int i)
reset method resets the timer.
i - an int value
public void set(int i,
String name)
set method sets the name of the ith timer.
i - an int valuename - a String valuepublic int getIndex(String name)
getIndex method gets the index of the
timer with the given name
name - a String value
int valuepublic long get(int i)
get method gets the value of the timer
with the given name check.
i - an int value
long value
public void add(int i,
long time)
add method add the time to the timer i.
i - an int valuetime - a long value
public void add(String name,
long time)
add method add the time to timer "name".
name - a String valuetime - a long valuepublic int size()
size method returns the number of timers.
int valuepublic void start(int i)
start method starts the ith timer.
i - an int valuepublic void stop(int i)
stop method stops the ith timer.
i - an int valuepublic void pause(int i)
pause method pause the ith timer.
i - an int valuepublic void resume(int i)
resume method resumes the ith timer.
i - an int valuepublic void printTimer(int i)
printTimer method prints the ith timer result
in seconds.
i - an int valuepublic void printTimer(String name)
printTimer method prints the ith timer result.
name - a String valuepublic void printTimers()
printTimers method prints all timer results.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||