Skip to content

Instantly share code, notes, and snippets.

@jjgod
Created July 25, 2008 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjgod/2366 to your computer and use it in GitHub Desktop.
Save jjgod/2366 to your computer and use it in GitHub Desktop.
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