public final class StopWatch extends Object
| Modifier and Type | Field and Description |
|---|---|
private long |
duration |
private long |
startNanos |
| Constructor and Description |
|---|
StopWatch()
Creates a StopWatch but does not start it
|
StopWatch(boolean autoStart) |
| Modifier and Type | Method and Description |
|---|---|
String |
calculateDataRate(long bytes) |
String |
getDuration() |
long |
getDuration(TimeUnit timeUnit)
Returns the amount of time that the StopWatch was running.
|
long |
getElapsed(TimeUnit timeUnit)
Returns the amount of time that has elapsed since the timer was started.
|
void |
start() |
void |
stop() |
public StopWatch()
public StopWatch(boolean autoStart)
autoStart - whether or not the timer should be started automaticallypublic void start()
public void stop()
public long getDuration(TimeUnit timeUnit)
timeUnit - the unit for which the duration should be reportedIllegalStateException - if the StopWatch has not been stopped via stop()public long getElapsed(TimeUnit timeUnit)
timeUnit - the unit for which the elapsed time should be computedpublic String calculateDataRate(long bytes)
public String getDuration()
Copyright © 2023 Apache NiFi Project. All rights reserved.