import time
import logging
import multiprocessing
def sleep_5_seconds():' Will sleep 5 seconds')
time.sleep(5)' Done sleeping 5 seconds')
def sleep_10_seconds():' Will sleep 10 seconds')
time.sleep(10)' Done sleeping 10 seconds')
def main():
logging.basicConfig(level = logging.INFO)
PROCESS1 = multiprocessing.Process(target = sleep_5_seconds)
PROCESS2 = multiprocessing.Process(target = sleep_10_seconds)
INFO:root: Will sleep 5 seconds
INFO:root: Will sleep 10 seconds
After 5 seconds
INFO:root: Done sleeping 5 seconds
After another 5 seconds
INFO:root: Done sleeping 10 seconds

I’m a Computer Science Undergrad on a quest to innovate and build stuff with code. Find all my posts at