import time
import zmq

context = zmq.Context()
receiver = context.socket(zmq.PULL)
receiver.bind("tcp://*:6666")

if __name__ == '__main__':

    s = receiver.recv()
    print('开始接收处理结果.....')
    print(s)
    time.sleep(1)

    # 计时，所有任务处理完一共需要多久
    tstart = time.time()

    # 接受十个任务的处理结果
    while True:
        s = receiver.recv_string()
        print(s)

    tend = time.time()
    print("四个同时工作，耗时: %d 秒" % (tend-tstart))
