Skip to content

Instantly share code, notes, and snippets.

@sfstpala
Created October 30, 2017 13:16
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 sfstpala/5b1c0a647824b19a831d2b3dc3017cfd to your computer and use it in GitHub Desktop.
Save sfstpala/5b1c0a647824b19a831d2b3dc3017cfd to your computer and use it in GitHub Desktop.
~ $ cat test.py
from time import sleep
from multiprocessing import Process
def loop_a():
sleep(2)
def loop_b():
sleep(2)
if __name__ == '__main__':
Process(target=loop_a).start()
Process(target=loop_b).start()
~ $ time python3 test.py
real 0m2.066s
user 0m0.046s
sys 0m0.018s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment