Lines Matching refs:setup
94 def _template_func(setup, func): argument
97 setup()
121 def __init__(self, stmt="pass", setup="pass", timer=default_timer): argument
127 if isinstance(setup, basestring):
128 compile(setup, dummy_src_name, "exec")
129 compile(setup + '\n' + stmt, dummy_src_name, "exec")
133 if isinstance(setup, basestring):
134 setup = reindent(setup, 4)
135 src = template % {'stmt': stmt, 'setup': setup, 'init': ''}
136 elif hasattr(setup, '__call__'):
139 ns['_setup'] = setup
148 if isinstance(setup, basestring):
149 _setup = setup
150 def setup(): function
152 elif not hasattr(setup, '__call__'):
154 self.inner = _template_func(setup, stmt)
234 def timeit(stmt="pass", setup="pass", timer=default_timer, argument
237 return Timer(stmt, setup, timer).timeit(number)
239 def repeat(stmt="pass", setup="pass", timer=default_timer, argument
242 return Timer(stmt, setup, timer).repeat(repeat, number)
275 setup = []
283 setup.append(a)
299 setup = "\n".join(setup) or "pass"
307 t = Timer(stmt, setup, timer)