#NEWLINE# def _make_runner( self , function_to_benchmark , args , kwargs ) : #NEWLINE# #INDENT# def runner( loops_range , timer = self . _timer ) : #NEWLINE# #INDENT# gc_enabled = gc . isenabled ( ) #NEWLINE# if self . _disable_gc : #NEWLINE# #INDENT# gc . disable ( ) #NEWLINE# #UNINDENT# tracer = sys . gettrace ( ) #NEWLINE# sys . settrace ( None ) #NEWLINE# try : #NEWLINE# #INDENT# if loops_range : #NEWLINE# #INDENT# start = timer ( ) #NEWLINE# for _ in loops_range : #NEWLINE# #INDENT# function_to_benchmark ( * args , ** kwargs ) #NEWLINE# #UNINDENT# end = timer ( ) #NEWLINE# return ( end - start ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# start = timer ( ) #NEWLINE# result = function_to_benchmark ( * args , ** kwargs ) #NEWLINE# end = timer ( ) #NEWLINE# return ( ( end - start ) , result ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# sys . settrace ( tracer ) #NEWLINE# if gc_enabled : #NEWLINE# #INDENT# gc . enable ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return kwargs