Skip to content

Instantly share code, notes, and snippets.

@thecodemedia
Created June 29, 2021 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thecodemedia/741048579ad043da46e5beb7eb0beeea to your computer and use it in GitHub Desktop.
Save thecodemedia/741048579ad043da46e5beb7eb0beeea to your computer and use it in GitHub Desktop.
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