Package org.slf4j.profiler
Class StopWatch
java.lang.Object
org.slf4j.profiler.StopWatch
- All Implemented Interfaces:
TimeInstrument
A very basic
TimeInstrument which can be started and stopped
once and only once.- Author:
- Ceki Gülcü
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal longTime elapsed between start and stop, in nanoseconds.getName()All time instruments are named entities.org.slf4j.profiler.TimeInstrumentStatusvoidlog()If the time instrument has an associated logger, then log information about this time instrument.voidprint()Print information about this time instrument on the console.voidStart this time instrument.stop()Stop this time instrument.stop(long stopTime) toString()
-
Constructor Details
-
StopWatch
-
-
Method Details
-
start
Description copied from interface:TimeInstrumentStart this time instrument.- Specified by:
startin interfaceTimeInstrument- Parameters:
name- the name of this instrument
-
getName
Description copied from interface:TimeInstrumentAll time instruments are named entities.- Specified by:
getNamein interfaceTimeInstrument- Returns:
- the name of this instrument
-
stop
Description copied from interface:TimeInstrumentStop this time instrument.- Specified by:
stopin interfaceTimeInstrument- Returns:
- this
-
stop
-
toString
-
elapsedTime
Description copied from interface:TimeInstrumentTime elapsed between start and stop, in nanoseconds.- Specified by:
elapsedTimein interfaceTimeInstrument- Returns:
- time elapsed in nanoseconds
-
getStatus
- Specified by:
getStatusin interfaceTimeInstrument
-
print
Description copied from interface:TimeInstrumentPrint information about this time instrument on the console.- Specified by:
printin interfaceTimeInstrument
-
log
Description copied from interface:TimeInstrumentIf the time instrument has an associated logger, then log information about this time instrument. Note thatStopWatchinstances cannot log whileProfilerinstances can.- Specified by:
login interfaceTimeInstrument
-