def Timeit(func,number=10000,module="__main__"):
    """ A wrapper which can
    be used to time any function """

    name = func.__name__
    t = timeit.Timer("%s()"%name, "from %s import %s" % (module, name))
    return "%.2f usec/pass" % (1000000*t.timeit(number=number)/number)
 A wrapper which can
    be used to time any function 
recipes/Python/389767_Timeit_module_wrapper/recipe-389767.py