Lines Matching refs:setup
17 -s/--setup S: statement to be executed once initially (default 'pass').
18 Execution time of this setup statement is NOT timed.
67 # in Timer.__init__() depend on setup being indented 4 spaces and stmt
71 {setup}
88 statement used for setup, and a timer function. Both statements
102 def __init__(self, stmt="pass", setup="pass", timer=default_timer,
109 if isinstance(setup, str):
111 compile(setup, dummy_src_name, "exec")
112 stmtprefix = setup + '\n'
113 setup = reindent(setup, 4)
114 elif callable(setup):
115 local_ns['_setup'] = setup
118 setup = '_setup()'
120 raise ValueError("setup is neither a string nor callable")
131 src = template.format(stmt=stmt, setup=setup, init=init)
167 To be precise, this executes the setup statement once, and
171 to one million. The main statement, the setup statement and
231 def timeit(stmt="pass", setup="pass", timer=default_timer,
234 return Timer(stmt, setup, timer, globals).timeit(number)
236 def repeat(stmt="pass", setup="pass", timer=default_timer,
239 return Timer(stmt, setup, timer, globals).repeat(repeat, number)
263 ["number=", "setup=", "repeat=",
274 setup = []
283 if o in ("-s", "--setup"):
284 setup.append(a)
305 setup = "\n".join(setup) or "pass"
315 t = Timer(stmt, setup, timer)