public class StopWatch extends Object implements TimeInstrument
TimeInstrument which can be started and stopped
once and only once.| Modifier and Type | Method and Description |
|---|---|
long |
elapsedTime()
Time elapsed between start and stop, in nanoseconds.
|
String |
getName()
All time instruments are named entities.
|
org.slf4j.profiler.TimeInstrumentStatus |
getStatus() |
void |
log()
If the time instrument has an associated logger, then log information about
this time instrument.
|
void |
print()
Print information about this time instrument on the console.
|
void |
start(String name)
Start this time instrument.
|
TimeInstrument |
stop()
Stop this time instrument.
|
StopWatch |
stop(long stopTime) |
String |
toString() |
public void start(String name)
TimeInstrumentstart in interface TimeInstrumentpublic String getName()
TimeInstrumentgetName in interface TimeInstrumentpublic TimeInstrument stop()
TimeInstrumentstop in interface TimeInstrumentpublic final long elapsedTime()
TimeInstrumentelapsedTime in interface TimeInstrumentpublic org.slf4j.profiler.TimeInstrumentStatus getStatus()
getStatus in interface TimeInstrumentpublic void print()
TimeInstrumentprint in interface TimeInstrumentpublic void log()
TimeInstrumentStopWatch instances cannot log while Profiler
instances can.log in interface TimeInstrumentCopyright © 2005–2017 QOS.ch. All rights reserved.