Public Member Functions | |
StopWatch () | |
StopWatch (Logger logger) | |
void | setLogger (Logger logger) |
void | reset () |
long | getLapTimeMillis () |
long | getLapTimeNanos () |
void | logLapTime (String taskDesc) |
Private Attributes | |
Logger | m_logger |
long | m_startTime |
long | m_startTimeNanos |
Static Private Attributes | |
boolean | s_shutup = false |
final NumberFormat | millisecFormatter = new DecimalFormat("#.##") |
|
Ctor without logger provided. Either call |
|
Constructor that resets the time count.
|
|
Gets the time in milliseconds that has elapsed since this object was created or
The implementation simply relies on
|
|
Gets the time in nanoseconds that has elapsed since this object was created or
The implementation simply relies on
|
|
Logs a message about the elapsed time for a certain task. It uses log level If no logger has been supplied, it will get one using Logger#getLogger(java.lang.String). This ad-hoc logger will likely not work in an ACS environment where log handlers are configured for the needs of containers and remote logging. todo: provide nicer text mask for message
|
|
Reimplemented in alma::acs::time::Profiler.
|
|
|
|
|
|
|
|
|
|
When printing elapsed time in millisec, we only want to show two fractional digits. |
|
|