org.slf4j.profiler

Interface TimeInstrument

public interface TimeInstrument

This interface sets the methods that must be implemented by Profiler and StopWatch classes. It settles the general feel of the profiler package.

Author: Ceki Gülcü

Method Summary
longelapsedTime()
Time elapsed between start and stop, in nanoseconds.
StringgetName()
All time instruments are named entities.
TimeInstrumentStatusgetStatus()
voidlog()
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(String name)
Start tis time instrument.
TimeInstrumentstop()
Stop this time instrument.

Method Detail

elapsedTime

public long elapsedTime()
Time elapsed between start and stop, in nanoseconds.

Returns: time elapsed in nanoseconds

getName

public String getName()
All time instruments are named entities.

Returns: the name of this instrument

getStatus

public TimeInstrumentStatus getStatus()

log

public void log()
If the time instrument has an associated logger, then log information about this time instrument. Note that StopWatch instances cannot log while Profiler instances can.

print

public void print()
Print information about this time instrument on the console.

start

public void start(String name)
Start tis time instrument.

Parameters: name

stop

public TimeInstrument stop()
Stop this time instrument.

Returns: this

Copyright © 2005-2009 QOS.ch. All Rights Reserved.