def bench(func):
 sys.stdout.write(('%44s   ' % format_func(func)))
 sys.stdout.flush()
 for i in xrange(3, 10):
  rounds = (1 << i)
  t = timer()
  for x in xrange(rounds):
   func()
  if ((timer() - t) >= 0.2):
   break
 def _run():
  gc.collect()
  gc.disable()
  try:
   t = timer()
   for x in xrange(rounds):
    func()
   return (((timer() - t) / rounds) * 1000)
  finally:
   gc.enable()
 delta = median((_run() for x in xrange(TEST_RUNS)))
 sys.stdout.write(('%.4f\n' % delta))
 sys.stdout.flush()
 return delta

def bench ( func ) : sys . stdout . write ( ( '%44s   ' % format_func ( func ) ) ) sys . stdout . flush ( ) for i in xrange ( 3 , 10 ) : rounds = ( 1 << i ) t = timer ( ) for x in xrange ( rounds ) : func ( ) if ( ( timer ( ) - t ) >= 0.2 ) : break def _run ( ) : gc . collect ( ) gc . disable ( ) try : t = timer ( ) for x in xrange ( rounds ) : func ( ) return ( ( ( timer ( ) - t ) / rounds ) * 1000 ) finally : gc . enable ( ) delta = median ( ( _run ( ) for x in xrange ( TEST_RUNS ) ) ) sys . stdout . write ( ( '%.4f\n' % delta ) ) sys . stdout . flush ( ) return delta
times a single function .