org.mmbase.bridge.jsp.taglib.debug
Class TimerTag

org.mmbase.bridge.jsp.taglib.ContextReferrerTag
  |
  +--org.mmbase.bridge.jsp.taglib.debug.TimerTag

public class TimerTag
extends ContextReferrerTag

Times how long the executing of the body took, and logs this. Child elements can also time theirselves, and appear in the 'total times' overview.

Author:
Michiel Meeuwissen

Fields inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
contextId, PAGE_CATEGORY, pageContextTag, referid
 
Constructor Summary
TimerTag()
           
 
Method Summary
 int doAfterBody()
           
 int doStartTag()
          Initialize timer.
 long haltTimer(int handle)
          Stops the timer identified by the handle, and logs and returns the result in second.
 void setName(java.lang.String n)
           
 int startTimer(java.lang.String id)
           
 int startTimer(java.lang.String id, java.lang.String id2)
          Starts a timer.
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
findParentTag, findParentTag, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContextTag, getObject, getReferid, getString, release, setContext, setPageContext, setReferid
 

Constructor Detail

TimerTag

public TimerTag()
Method Detail

setName

public void setName(java.lang.String n)
             throws javax.servlet.jsp.JspTagException

startTimer

public int startTimer(java.lang.String id,
                      java.lang.String id2)
Starts a timer.
Parameters:
id - An id which optionally can be null. Can e.g. be getId().
id2 - Another id which cannot be null. Something descriptive.
Returns:
an integer handle, which you need to remember to halt the timer.

startTimer

public int startTimer(java.lang.String id)

haltTimer

public long haltTimer(int handle)
Stops the timer identified by the handle, and logs and returns the result in second.

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspTagException
Initialize timer.

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspTagException


MMBase 2002