import timeit


def benchmark_it(func, repeat=3, number=1000):
    """
    Benchmark <func> by taking the shortest time of <repeat==3> test runs.
    """
    #print(s.ljust(20), end=" ")
    res = func()
    print(str(func) + ' took {:>5.0f} ms'.format(min(timeit.repeat(func,
                                          repeat=repeat,
                                          number=number)) * 1000))
    return res