public class MyTimer
extends java.lang.Object
Constructor and Description |
---|
MyTimer()
Creates a new timer.
|
Modifier and Type | Method and Description |
---|---|
double |
getAvgTime()
Returns the average time in seconds recorded over all start-stop calls.
|
double |
getTime()
Returns the elapsed time in seconds since the last start-stop calls.
|
double |
getTotalTime()
Returns the total time in seconds recorded over all start-stop calls.
|
static void |
main(java.lang.String[] args)
Demo of usage
|
void |
resetAvgs()
Resets to zero the average and total time recorded over all start-stop calls.
|
void |
start()
Starts the timer.
|
void |
stop()
Stops the timer.
|
public static void main(java.lang.String[] args)
args
- public void start()
public void stop()
public double getTime()
public double getAvgTime()
public double getTotalTime()
public void resetAvgs()