| Trees | Indices | Help |
|
|---|
|
|
Provides a countdown timer for functions that run repeatedly.
There are two distinct ways to use the timer.
The first, via call_and_time(), is for calling some function every specified number of steps for a specified duration. Currently call_and_time() is used for timing calls to simulation.run() every 1.0 steps for 100 iterations. See the Simulation class for an example of using the timer in this way.
The second, via call_fixed_num_times(), is for calling some function repeatedly a specified number of times. A case to use call_fixed_num_times() would be timing pattern presentations, where the number of times the pattern_presenter will be called is known in advance. Additionally, this method allows a list of arguments to be passed to the function (in this case, the permutation for each call).
|
|||
|
Inherited from |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
step = param.Parameter(default= 2, doc= """Only relevant with Only relevant with call_and_time(), not call_fixed_num_times(). |
|||
estimate_interval = param.Number(default= 50, doc= """IntervalInterval in simulation time between estimates. |
|||
func = param.Parameter(default= None, instantiate= True, doc= Function to be timed. |
|||
simulation_time_fn = param.Parameter(default= None, instantiatFunction that returns the simulation time. |
|||
real_time_fn = param.Parameter(default= time.time, instantiateFunction that returns the wallclock time. |
|||
receive_info = param.Parameter(default= [], instantiate= True,List of objects that will receive timing information. |
|||
stop = param.Boolean(default= False, doc= """If set to True, eIf set to True, execution of func (and timing) will cease at the end of the current iteration. |
|||
name = <param.parameterized.String object at 0xa54adac>String identifier for this object. |
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
stepOnly relevant with call_and_time(), not call_fixed_num_times(). Each iteration, func is called as func(step). For example, step=1 with func set to topo.sim.time would cause the simulation time to advance once per iteration. The default value (None) gives 50 iterations for any value of simulation_duration passed to call_and_time(simulation_duration).
|
estimate_intervalInterval in simulation time between estimates.
|
funcFunction to be timed.
|
simulation_time_fnFunction that returns the simulation time.
|
real_time_fnFunction that returns the wallclock time.
|
receive_infoList of objects that will receive timing information. Each must have a timing_info() method.
|
stopIf set to True, execution of func (and timing) will cease at the end of the current iteration.
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Aug 5 14:59:33 2010 | http://epydoc.sourceforge.net |