Package com.sun.faces.util
Class Timer
- java.lang.Object
-
- com.sun.faces.util.Timer
-
public class Timer extends Object
This class is a simple wrapper for timing method calls. The traditional method is to add two variables, start, and stop, and display the difference of these values. Encapsulates the process.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Timer
getInstance()
static Timer
getInstance(Level logLevel)
void
logResult(String taskInfo)
Log the timing result.void
startTiming()
Start timing.void
stopTiming()
Stop timing.
-
-
-
Method Detail
-
getInstance
public static Timer getInstance()
- Returns:
- a new
Timer
instance if theTIMING
logging level isFINE
, otherwise, return null;
-
startTiming
public void startTiming()
Start timing.
-
stopTiming
public void stopTiming()
Stop timing.
-
logResult
public void logResult(String taskInfo)
Log the timing result.- Parameters:
taskInfo
- task description
-
-