Reset timer value in python [closed]

-2
import time
start=time.time()
fim=time.time()

How do I reset the team? I want it to go back to zero and start a new count without the program ending. Do this 3 times.

    
asked by anonymous 02.01.2019 / 17:39

1 answer

0

[TL; DR]
Using Treading:

from threading import Timer

def reset_time(count):
  count = count+1 if count is not None else 0
  print('Time out', count)

for i in range(3):
  time_for_reset = 5.0 # Em segundos
  t = Timer(time_for_reset, reset_time(i))
  t.cancel()
  t.start()

See working at repl.it

    
02.01.2019 / 18:54