Class Timings

java.lang.Object
net.tnemc.plugincore.core.utils.Timings
All Implemented Interfaces:
AutoCloseable

public class Timings extends Object implements AutoCloseable
Timings
Since:
0.1.2.0
Author:
creatorfromhell
  • Constructor Details

  • Method Details

    • start

      public Timings start()
      Starts our timings in order to measure duration of methods or actions.
      Returns:
      The timings object.
    • withStatement

      public Timings withStatement(String statement)
      Used to build our timings with a statement for logging purposes.
      Parameters:
      statement - The statement to use.
      Returns:
      The timings instance.
    • stop

      public long stop()
      Stops the timings and returns the duration.
      Returns:
      Return the duration this timing lasted.
    • stopLog

      public void stopLog(DebugLevel level)
      Stops the timings and logs it to the console and server log.
      Parameters:
      level - The DebugLevel to use for this.
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception