I have been running multiprocessing trying to learn the methods for days. I follow the instructions and follow the code. I keep running into a circular import error. I believe it may be something to do with the filling of python or visual studio like a path issue. but I'm not sure.
import time
import multiprocessing
start = time.perf_counter()
def do_something():
print('Sleeping 1 second...')
time.sleep(1)
print('Done Sleeping...')
p1 = multiprocessing.Process(target= do_something)
p1 = multiprocessing.Process(target= do_something)
p1.start()
p2.start()
finish = time.perf_counter
print(f'Finsihed in{round(finish-start, 2)} second(s)')