Created
June 29, 2021 04:50
-
-
Save thecodemedia/741048579ad043da46e5beb7eb0beeea 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
import time | |
from threading import Thread | |
def sleepMe(i): | |
print("Поток %i засыпает на 5 секунд.\n" % i) | |
time.sleep(5) | |
print("Поток %i сейчас проснулся.\n" % i) | |
for i in range(10): | |
th = Thread(target=sleepMe, args=(i, )) | |
th.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment