def time_throughput(nmessages, t=0, f=wait):
    client = parallel.Client()
    view = client.load_balanced_view()
    # do one ping before starting timing
    if f is echo:
        t = np.random.random(t/8)
    view.apply_sync(echo, '')
    client.spin()
    tic = time.time()
    for i in range(nmessages):
        view.apply(f, t)
    lap = time.time()
    client.wait()
    toc = time.time()
    return lap-tic, tic-toc
dataset/ETHPy150Open ipython/ipython-py3k/docs/examples/newparallel/demo/throughput.py/time_throughput/swapped operands of `-`