| java.lang.Object org.ofbiz.base.util.UtilTimer
UtilTimer | public class UtilTimer (Code) | | Timer handling utility
Utility class for simple reporting of the progress of a process.
Steps are labelled, and the time between each label (or message)
and the time since the start are reported in each call to timerString.
|
Method Summary | |
public static void | closeTimer(String timerName) | public static void | closeTimer(String timerName, String message) | public static void | closeTimer(String timerName, String message, String module) | public boolean | getLog() | public String | getName() | public static UtilTimer | getTimer(String timerName) | public static UtilTimer | getTimer(String timerName, boolean log) | public boolean | isRunning() | public static UtilTimer | makeTimer() | public double | secondsSinceLast() | public double | secondsSinceStart() | public void | setLog(boolean log) | public void | startTimer() | public long | timeSinceLast() | public long | timeSinceStart() | public static void | timerLog(String timerName, String message, String module) | public String | timerString(String message) | public String | timerString(String message, String module) | public String | timerString(int level, String message) Creates a string with information including the passed message, the time since the last call,
and the time since the beginning. |
lastMessageTime | protected long lastMessageTime(Code) | | |
log | protected boolean log(Code) | | |
realStartTime | protected long realStartTime(Code) | | |
running | protected boolean running(Code) | | |
startTime | protected long startTime(Code) | | |
staticTimers | protected static Map staticTimers(Code) | | |
UtilTimer | public UtilTimer()(Code) | | Default constructor. Starts the timer.
|
UtilTimer | public UtilTimer(String timerName, boolean start)(Code) | | |
UtilTimer | public UtilTimer(String timerName, boolean start, boolean log)(Code) | | |
closeTimer | public static void closeTimer(String timerName)(Code) | | |
getLog | public boolean getLog()(Code) | | Gets the value of the log member, denoting whether log output is off or not
The value of log |
isRunning | public boolean isRunning()(Code) | | |
secondsSinceLast | public double secondsSinceLast()(Code) | | Returns the number of seconds since the last time timerString was called
The number of seconds since the last time timerString was called |
secondsSinceStart | public double secondsSinceStart()(Code) | | Returns the number of seconds since the timer started
The number of seconds since the timer started |
setLog | public void setLog(boolean log)(Code) | | Sets the value of the log member, denoting whether log output is off or not
Parameters: log - The new value of log |
startTimer | public void startTimer()(Code) | | |
timeSinceLast | public long timeSinceLast()(Code) | | Returns the number of milliseconds since the last time timerString was called
The number of milliseconds since the last time timerString was called |
timeSinceStart | public long timeSinceStart()(Code) | | Returns the number of milliseconds since the timer started
The number of milliseconds since the timer started |
timerString | public String timerString(String message)(Code) | | Creates a string with information including the passed message, the last passed message and the time since the last call, and the time since the beginning
Parameters: message - A message to put into the timer String A String with the timing information, the timer String |
timerString | public String timerString(String message, String module)(Code) | | Creates a string with information including the passed message, the last passed message and the time since the last call, and the time since the beginning
Parameters: message - A message to put into the timer String Parameters: module - The debug/log module/thread to use, can be null for root module A String with the timing information, the timer String |
timerString | public String timerString(int level, String message)(Code) | | Creates a string with information including the passed message, the time since the last call,
and the time since the beginning. This version allows an integer level to be specified to
improve readability of the output.
Parameters: level - Integer specifying how many levels to indent the timer string so the output can be more easily read through nested method calls. Parameters: message - A message to put into the timer String A String with the timing information, the timer String |
|
|