Package com.illumon.util
Class Utils.Timer
java.lang.Object
com.illumon.util.Utils.Timer
- Enclosing class:
- Utils
public static class Utils.Timer extends Object
Mark a start time, and allow logging of elapsed time and time between log messages (steps of a process).
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
elapsed(String message)
log "message: elapsed xx ms"void
elapsedAndStep(String message)
log "message: step time xx ms, elapsed xx ms"static com.fishlib.io.log.LogLevel
getDefaultLogLevel()
Get (and possibly initialize) the default log level for Timers, configured byDEFAULT_LOG_LEVEL_PROP
com.fishlib.io.log.LogLevel
getLogLevel()
return the LogLevel configured for this timer.long
getStepTime()
Get the elapsed time for the current step.static void
setDefaultLogLevel(com.fishlib.io.log.LogLevel level)
Set the static default log level for Timers.
-
Constructor Details
-
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
-