def bench(calc_pi, samples=1000000, iters=25):
    func_name = calc_pi.__name__[8:]
    print("Monte carlo estimate of pi on %s with %d million samples: %f" % \
          (func_name, samples/1e6, calc_pi(samples)))

    start = time()
    for k in frange(iters):
        calc_pi(samples)
    end = time()

    print("Average time taken: %f ms" % (1000 * (start - end) / iters))
dataset/ETHPy150Open arrayfire/arrayfire-python/examples/benchmarks/monte_carlo_pi.py/bench/swapped operands of `-`