java.io.Closeable, java.lang.AutoCloseablepublic class StopWatch
extends java.lang.Object
implements java.io.Closeable
| Constructor | Description |
|---|---|
StopWatch() |
|
StopWatch(Timer timer) |
Used for tests to be able to create a StopWatch which does not follow real
time.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
boolean |
isRunning() |
The method is used to find out if the StopWatch is started.
|
long |
now() |
|
long |
now(java.util.concurrent.TimeUnit timeUnit) |
now.
|
StopWatch |
reset() |
Reset elapsed time to zero and make the state of stopwatch stop.
|
StopWatch |
start() |
Start to measure times and make the state of stopwatch running.
|
StopWatch |
stop() |
Stop elapsed time and make the state of stopwatch stop.
|
java.lang.String |
toString() |
public StopWatch()
public StopWatch(Timer timer)
timer - The timer to base this StopWatch's timekeeping off of.public boolean isRunning()
public StopWatch start()
public StopWatch stop()
public StopWatch reset()
public long now(java.util.concurrent.TimeUnit timeUnit)
timeUnit - timeUnit.public long now()
public java.lang.String toString()
toString in class java.lang.Objectpublic void close()
close in interface java.lang.AutoCloseableclose in interface java.io.CloseableCopyright © 2008–2025 Apache Software Foundation. All rights reserved.