Created
July 25, 2008 02:38
-
-
Save jjgod/2366 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
import time, threading, processing | |
for cls in [threading.Thread, processing.Process]: | |
start = time.time() | |
for _ in range(1000): | |
child = cls(target=lambda: None) | |
child.start() | |
child.join() | |
print 'Spawning 100 children with %s took %.2fs' % ( | |
cls.__name__, time.time() - start) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment