public interface OpTimer
The construction of an OpTimer object sets the timer running. There is no "start" method.
Once the end() method has been called, the OpTimer must not be called again. It is a one short object.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
OpTimer.HeisenburgResultSetCalculator
This interface can be used to avoid HEISENBERG effects when trying to time how long an operation takes.
|
static interface |
OpTimer.OnEndCallback
This interface can be provided to
OpTimerFactory are creation time to have a call back
when end(long) is called |
| Modifier and Type | Method and Description |
|---|---|
OpSnapshot |
end()
Call this in a finally{} block or at the end of the operation to stop the clock
|
OpSnapshot |
end(long resultSetSize)
Call this in a finally{} block or at the end of the operation to stop the clock
|
OpSnapshot |
end(OpTimer.HeisenburgResultSetCalculator heisenburgResultSetCalculator)
Call this in a finally{} block or at the end of the operation to stop the clock
|
OpSnapshot |
endWithTime(long timeInMillis)
Call this in a finally{} block or at the end of the operation with the time taken by the operation
|
String |
getName()
The name of the timer.
|
OpSnapshot |
snapshot()
This will return a snap shot of how long the timer has been running for.
|
String getName()
OpSnapshot snapshot()
OpSnapshot endWithTime(long timeInMillis)
timeInMillis - Time taken by the operationOpSnapshot end(long resultSetSize)
resultSetSize - the size of the operations result.OpSnapshot end()
The result set size will be set to Double.NAN.
OpSnapshot end(OpTimer.HeisenburgResultSetCalculator heisenburgResultSetCalculator)
heisenburgResultSetCalculator - a class to calculate the timeCopyright © 2016 Atlassian. All rights reserved.