|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ckkloverdos.time.SimpleTimeCounter
public class SimpleTimeCounter
A simple start-stop counter. Not-synchronized.
| Constructor Summary | |
|---|---|
SimpleTimeCounter()
Creates a new instance and starts the counter immediately. |
|
SimpleTimeCounter(boolean start)
Creates a new instance, optionally starting the counter if start is true. |
|
| Method Summary | |
|---|---|
long |
millis()
If the timer has not been started, returns zero, otherwise returns the time of the last stop minus the time of the last start. |
java.lang.String |
millisInfo()
|
long |
restart()
Computes the same value as stop(). |
double |
seconds()
|
java.lang.String |
secondsInfo()
|
void |
start()
Starts the counter. |
long |
stop()
Stops the counter and returns the time difference between now and the previous start() action. |
java.lang.String |
timeInfo()
Returns a string representation of the time passed, in the format [x days,] HH:MM:SS.LLL, where LLL are the
milliseconds and the rest is obvious :-). |
java.lang.String |
toString()
|
java.lang.String |
unitsPerMillis(int units,
java.lang.String unitsname)
|
java.lang.String |
unitsPerSec(int units,
java.lang.String unitsname)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleTimeCounter()
public SimpleTimeCounter(boolean start)
start is true.
start - | Method Detail |
|---|
public void start()
public long stop()
start() action.
public long restart()
stop(). In effect it successively stops
and starts the counter in one step.
public long millis()
public double seconds()
public java.lang.String secondsInfo()
public java.lang.String millisInfo()
public java.lang.String timeInfo()
[x days,] HH:MM:SS.LLL, where LLL are the
milliseconds and the rest is obvious :-).
public java.lang.String toString()
toString in class java.lang.Object
public java.lang.String unitsPerSec(int units,
java.lang.String unitsname)
public java.lang.String unitsPerMillis(int units,
java.lang.String unitsname)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||