Interface TimeInstrument

  • All Known Implementing Classes:
    Profiler, StopWatch

    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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method 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.
    • Method Detail

      • getName

        String getName()
        All time instruments are named entities.
        Returns:
        the name of this instrument
      • getStatus

        org.slf4j.profiler.TimeInstrumentStatus getStatus()
      • start

        void start​(String name)
        Start this time instrument.
        Parameters:
        name - the name of this instrument
      • elapsedTime

        long elapsedTime()
        Time elapsed between start and stop, in nanoseconds.
        Returns:
        time elapsed in nanoseconds
      • print

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

        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.