Created
May 15, 2013 09:35
-
-
Save venthur/5582778 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from multiprocessing import Process | |
import time | |
timer = time.clock | |
def proc(): | |
time.sleep(1) | |
for i in range(10): | |
print('P2 {time}'.format(time=timer())) | |
time.sleep(1) | |
if __name__ == '__main__': | |
p = Process(target=proc) | |
p.start() | |
for i in range(10): | |
print('P1 {time}'.format(time=timer())) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment