All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.slf4j.profiler.TimeInstrument Maven / Gradle / Ivy

There is a newer version: 3.0.0.Alpha1
Show newest version
package org.slf4j.profiler;


/**
 * This interface sets the methods that must be implemented by 
 * {@link Profiler} and {@link  StopWatch} classes. It settles the 
 * general feel of the profiler package.
 * 
 * @author Ceki Gülcü
 *
 */
public interface TimeInstrument {

  /**
   * All time instruments are named entities.
   * @return the name of this instrument
   */
  String getName();
  
  
  TimeInstrumentStatus getStatus();
  
  /**
   * Start tis time instrument.
   * 
   * @param name
   */
  void start(String name);
  
  /**
   * Stop this time instrument.
   * 
   * @return this
   */
  TimeInstrument stop();

  /**
   * Time elapsed between start and stop, in nanoseconds.
   * 
   * @return time elapsed in nanoseconds
   */
  long elapsedTime();
  
  /**
   * Print information about this time instrument on the console.
   */
  void print();
  
  /**
   * If the time instrument has an associated logger, then log information about 
   * this time instrument. Note that {@link StopWatch} instances cannot log while {@link Profiler}
   * instances can.
   */
  void log();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy