Home | History | Annotate | Download | only in Lib

Lines Matching refs:number

5 This module avoids a number of common traps for measuring execution
15 -n/--number N: how many times to execute 'statement' (default: see below)
30 If -n is not given, a suitable number of loops is calculated by trying
185 def timeit(self, number=default_number):
186 """Time 'number' executions of the main statement.
190 a number of times, as a float measured in seconds. The
191 argument is the number of times through the loop, defaulting
196 it = itertools.repeat(None, number)
198 it = [None] * number
208 def repeat(self, repeat=default_repeat, number=default_number):
224 of the result is probably the only number you should be
230 t = self.timeit(number)
235 number=default_number):
237 return Timer(stmt, setup, timer).timeit(number)
240 repeat=default_repeat, number=default_number):
242 return Timer(stmt, setup, timer).repeat(repeat, number)
266 ["number=", "setup=", "repeat=",
274 number = 0 # auto-determine
280 if o in ("-n", "--number"):
281 number = int(a)
308 if number == 0:
309 # determine number so that 0.2 <= total time < 2.0
311 number = 10**i
313 x = t.timeit(number)
318 print "%d loops -> %.*g secs" % (number, precision, x)
322 r = t.repeat(repeat, number)
329 print "%d loops," % number,
330 usec = best * 1e6 / number