import time from multiprocessing import Process, Pipe def f(conn): while 1: if conn.poll(1): conn.send('') conn.close() parent_conn, child_conn = Pipe() p = Process(target=f, args=(child_conn,)) p.start() startTime = time.time() parent_conn.send('123456789') while 1: a = parent_conn.recv() if a != None: print time.time() - startTime break