import threading
mport time
def myThread():
print("\nThread: {} starting".format(threading.currentThread().getName()))
time.sleep(5)
print("\nThread: {} ending".format(threading.currentThread().getName()))
for i in range(4):
threadName = "Thread-" + str(i)
thread = threading.Thread(name=threadName, target=myThread)
thread.start()
# print("\n{}".format(threading.enumerate()))
myThread()
Comments
Leave a comment