public class StopWatch extends Object implements Closeable
Constructor and Description |
---|
StopWatch() |
StopWatch(org.apache.hadoop.util.Timer timer)
Used for tests to be able to create a StopWatch which does not follow real
time.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isRunning()
The method is used to find out if the StopWatch is started.
|
long |
now() |
long |
now(TimeUnit timeUnit) |
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.
|
String |
toString() |
public StopWatch()
public StopWatch(org.apache.hadoop.util.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(TimeUnit timeUnit)
public long now()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2019 Apache Software Foundation. All Rights Reserved.