@InterfaceAudience.Public @InterfaceStability.Unstable public class OperationDuration extends Object
Constructor and Description |
---|
OperationDuration()
Instantiate.
|
Modifier and Type | Method and Description |
---|---|
Duration |
asDuration()
Get the duration of an operation as a java Duration
instance.
|
void |
finished()
Update the finished time with the current system time.
|
String |
getDurationString()
Return the duration as
humanTime(long) . |
static String |
humanTime(long time)
Convert to a human time of minutes:seconds.millis.
|
protected long |
time()
Evaluate the system time.
|
String |
toString()
Return the duration as
humanTime(long) . |
long |
value()
Get the duration in milliseconds.
|
public OperationDuration()
protected long time()
public void finished()
public String getDurationString()
humanTime(long)
.public static String humanTime(long time)
time
- time to humanize.public String toString()
humanTime(long)
.public long value()
This will be 0 until a call
to finished()
has been made.
public Duration asDuration()
Copyright © 2024 Apache Software Foundation. All rights reserved.