time de uma thread
unknown
python
3 years ago
379 B
14
Indexable
from threading import Thread
import time
dic = {'time': 0}
def temporizador():
count = 0
while True:
count += 1
dic.update({'time': count})
time.sleep(1)
Thread(target=temporizador).start()
def contador():
n = 0
while True:
t = dic['time'] #puxa time do dic
if t > n:
n = t
print(t)
contador()Editor is loading...