Package com.illumon.util
Class Utils.Timer
java.lang.Object
com.illumon.util.Utils.Timer
- Enclosing class:
- Utils
Mark a start time, and allow logging of elapsed time and time between log messages (steps of a process).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidlog "message: elapsed xx ms"voidelapsedAndStep(String message) log "message: step time xx ms, elapsed xx ms"static com.fishlib.io.log.LogLevelGet (and possibly initialize) the default log level for Timers, configured byDEFAULT_LOG_LEVEL_PROPcom.fishlib.io.log.LogLevelreturn the LogLevel configured for this timer.longGet the elapsed time for the current step.static voidsetDefaultLogLevel(com.fishlib.io.log.LogLevel level) Set the static default log level for Timers.
-
Constructor Details
-
Timer
public Timer(@NotNull com.fishlib.io.logger.Logger log) -
Timer
public Timer(@NotNull com.fishlib.io.logger.Logger log, @NotNull com.fishlib.io.log.LogLevel level)
-
-
Method Details
-
getDefaultLogLevel
public static com.fishlib.io.log.LogLevel getDefaultLogLevel()Get (and possibly initialize) the default log level for Timers, configured byDEFAULT_LOG_LEVEL_PROP- Returns:
- the default log level
-
setDefaultLogLevel
public static void setDefaultLogLevel(@NotNull com.fishlib.io.log.LogLevel level) Set the static default log level for Timers.- Parameters:
level- the new default level
-
elapsed
log "message: elapsed xx ms"- Parameters:
message- the message
-
elapsedAndStep
log "message: step time xx ms, elapsed xx ms"- Parameters:
message- the message
-
getStepTime
public long getStepTime()Get the elapsed time for the current step.- Returns:
- now - markTime
-
getLogLevel
public com.fishlib.io.log.LogLevel getLogLevel()return the LogLevel configured for this timer.- Returns:
- the configured LogLevel
-