Created
October 30, 2017 13:16
-
-
Save sfstpala/5b1c0a647824b19a831d2b3dc3017cfd 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
~ $ 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