You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
241 B
13 lines
241 B
11 months ago
|
import threading
|
||
|
import time
|
||
|
|
||
|
def tarea():
|
||
|
time.sleep(1)
|
||
|
return
|
||
|
|
||
|
for _ in range(10):
|
||
|
threading.Thread(target=tarea).start()
|
||
|
|
||
|
print ("Hilos activos: ",threading.active_count())
|
||
|
for thread in threading.enumerate():
|
||
|
print(thread.name)
|