summon.timer
index
/home/raz/projects/summon/lib/summon/timer.py

Timer class for timing nested sections of code
 
file:   rasmus/timer.py
author: Matt Rasmussen
date:   2/4/2005

 
Modules
       
os
sys
time
traceback

 
Classes
       
Timer

 
class Timer
     Methods defined here:
__init__(self, stream=<open file '<stderr>', mode 'w'>, maxdepth=inf)
addStream(self, stream, maxdepth=inf)
depth(self)
Get the current number of running timers
error(self, text, offset=0)
Write an error message to the timer output stream
flush(self)
indent(self)
Write the current indentation level to the timer output stream
log(self, *text)
Write a message to the timer stream.  Message will be written with 
current indentation level
logExact(self, text)
Write the extact string 'text' to the timer output stream with no 
additional indentation.
removeStream(self, stream)
reset(self)
Stop all timers
start(self, msg='')
Start a new timer
stop(self)
Stop the last created timer and return duration in seconds
suppress(self)
Calling this function will suppress timer output messages until 
unsuppress() is called.  
 
If suppress() is called multiple times,  unsuppress() must be called
an equal number of times to resume timer  output.  This is useful for
nesting suppress/unsuppress.
time(self)
Get the current duration of the timer
unsuppress(self)
Calling this function will resume timer output messages that were
disabled with suppress().
 
If suppress() is called multiple times,  unsuppress() must be called
an equal number of times to resume timer  output.  This is useful for
nesting suppress/unsuppress.
warn(self, text, offset=0)
Write a warning message to the timer output stream
write(self, text)

 
Functions
       
current_code(offset=0)
current_file(offset=0, abbrv=True)
current_func(offset=0)
current_line(offset=0)
error(text, offset=0)
globalTimer()
indent()
log(*text)
logExact(text)
logger(*text)
note(*text)
notefile(out=None)
noteflush()
tic(msg='')
toc()
warn(text, offset=0)

 
Data
        GLOBAL_NOTES = None
RASMUS_TIMER = None