www.element4solution.com

e4s.util
Class E4DurationTimer

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.util.E4DurationTimer

public class E4DurationTimer
extends E4Object

Object for timing measurements within the E4S environment. This mechanism is dived into two parts: an object holding the position of the timer, related to the source code (classname, method and linenumber) and other related objects holding the timing values.

See Also:
createTimer(), createTimer(String)

Nested Class Summary
static class E4DurationTimer.E4DurationTimerPosition
          Position of the Timer, related to the Java source code (class, method and linenumber).
 
Field Summary
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
 void close()
          Close but track that timer object.
static E4DurationTimer createTimer()
          Create an unnamed timer.
static E4DurationTimer createTimer(java.lang.String name)
          Create a named timer.
 void finalize()
           
static E4DurationTimer.E4DurationTimerPosition findTimerPosition(java.lang.String name)
          Find a timer position by a specified name.
static long getOverheadTime()
          This is the overheaded time in milliseconds which is considerated each time a timer will be called.
static E4DurationTimer.E4DurationTimerPosition[] getTimer()
          Get an array of all timer positions.
static void rem(E4HtmlContentElement html)
          Include a listing of timers withing HTML context as remark.
static void removeTimerPosition(java.lang.String name)
          Remove a timer position by a specified name.
static void resetAllTimers()
          Reset all timers.
static void trace()
          Print a listing of timers to the standard output (System.out).
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, toString, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

close

public void close()
Close but track that timer object. Please note, that a timer object shall only be used once.


finalize

public void finalize()
Overrides:
finalize in class E4Object

createTimer

public static E4DurationTimer createTimer()
Create an unnamed timer. Timers can be used to track the performance of your application, you may use a timer only once and need to call the close() method to track. Please note, that the use of timers will slow down your application.

Returns:
the new created timer.

createTimer

public static E4DurationTimer createTimer(java.lang.String name)
Create a named timer. Timers can be used to track the performance of your application, you may use a timer only once and need to call the close() method to track. Please note, that the use of timers will slow down your application.

Parameters:
an - optional name for this timer. Timers will be identified by their position in the sourcecode by using the StackTraceElement.
Returns:
the new created timer.

trace

public static void trace()
Print a listing of timers to the standard output (System.out).


rem

public static void rem(E4HtmlContentElement html)
Include a listing of timers withing HTML context as remark.

See Also:
E4HtmlContentElement.rem(String)

getTimer

public static E4DurationTimer.E4DurationTimerPosition[] getTimer()
Get an array of all timer positions.

Returns:
an array of timer positions

resetAllTimers

public static void resetAllTimers()
Reset all timers.


findTimerPosition

public static E4DurationTimer.E4DurationTimerPosition findTimerPosition(java.lang.String name)
Find a timer position by a specified name.

Parameters:
name - the specified timer name
Returns:
the timer position or null if not found

removeTimerPosition

public static void removeTimerPosition(java.lang.String name)
Remove a timer position by a specified name.

Parameters:
name - the specified timer name

getOverheadTime

public static long getOverheadTime()
This is the overheaded time in milliseconds which is considerated each time a timer will be called.


_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com