def test(func, howmany=1):
        """Run function speed test #howmany times, and display the: average, total, repeat times.
        you can call this simply by Timer.test(func)
        
        for more complicate case, use standard library 
        'timeit <https://docs.python.org/2/library/timeit.html>'_
        """
        elapse = timeit.Timer(func).timeit(howmany)
        print("average = %0.6f seconds, total = %0.6f seconds, repeat %s times." % (
                elapse/howmany, elapse, howmany) )
def test ( func , howmany = 1 ) : elapse = timeit . Timer ( func ) . timeit ( howmany ) print ( "average = %0.6f seconds, total = %0.6f seconds, repeat %s times." % ( elapse / howmany , elapse , howmany ) )
Run function speed test #howmany times, and display the: average, total, repeat times.
        you can call this simply by Timer.test(func)
        
        for more complicate case, use standard library 
        'timeit <https://docs.python.org/2/library/timeit.html>'_