|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.gadgets.StopWatch
public class StopWatch
A basic stopwatch; handy for testing and such.
| Constructor Summary | |
|---|---|
StopWatch()
|
|
| Method Summary | |
|---|---|
double |
getAverage()
Get the average time for all runs. |
java.lang.String |
getAverageString()
Get the average time for all runs as a formatted string. |
long |
getCurrentTime()
Get the time since last start. |
java.lang.String |
getCurrentTimeString()
Get the time since last start as a formatted string. |
long |
getLastTime()
Get the last timing run. |
java.lang.String |
getLastTimeString()
Get the last timing run as a formatted string. |
java.lang.String |
getMemoryUsageString()
Handy; reports memory usage as a string. |
int |
getNumRuns()
Get the number of timing runs. |
double |
getRecentAverage()
|
java.lang.String |
getRecentAverageString()
|
long |
getTotalTime()
Get the total of all timing runs. |
java.lang.String |
getTotalTimeString()
Get the total of all timing runs as a formatted string. |
boolean |
isRunning()
True if watch is running. |
static double |
millisToHertz(double millis)
Converts millisecond timing to runs per second. |
static double |
millisToSeconds(double millis)
Converts milliseconds to thousandths of a second. |
static java.lang.String |
millisToString(long millis)
|
void |
reset()
Reset everything. |
void |
start()
Start the clock. |
void |
stop()
Stop the clock. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StopWatch()
| Method Detail |
|---|
public static java.lang.String millisToString(long millis)
public static double millisToSeconds(double millis)
public static double millisToHertz(double millis)
public void start()
public void stop()
public long getLastTime()
public java.lang.String getLastTimeString()
public long getTotalTime()
public java.lang.String getTotalTimeString()
public long getCurrentTime()
public java.lang.String getCurrentTimeString()
public int getNumRuns()
public double getAverage()
public java.lang.String getAverageString()
public void reset()
public boolean isRunning()
public java.lang.String getMemoryUsageString()
public double getRecentAverage()
public java.lang.String getRecentAverageString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||