Package net.tnemc.plugincore.core.utils
Class Timings
java.lang.Object
net.tnemc.plugincore.core.utils.Timings
- All Implemented Interfaces:
AutoCloseable
Timings
- Since:
- 0.1.2.0
- Author:
- creatorfromhell
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
start()
Starts our timings in order to measure duration of methods or actions.long
stop()
Stops the timings and returns the duration.void
stopLog
(DebugLevel level) Stops the timings and logs it to the console and server log.withStatement
(String statement) Used to build our timings with a statement for logging purposes.
-
Constructor Details
-
Timings
public Timings()
-
-
Method Details
-
start
Starts our timings in order to measure duration of methods or actions.- Returns:
- The timings object.
-
withStatement
Used to build our timings with a statement for logging purposes.- Parameters:
statement
- The statement to use.- Returns:
- The timings instance.
-
stop
Stops the timings and returns the duration.- Returns:
- Return the duration this timing lasted.
-
stopLog
Stops the timings and logs it to the console and server log.- Parameters:
level
- The DebugLevel to use for this.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-