As stated in the question above, I wanted to create/implement a Timer to be used in a Maths Test program so that the user can view the timer whilst the system executes various commands. I've tried many timers such as:
import time
s=0
m=0
while s<=60:
os.system('cls')
print (m, 'Minutes', s, 'Seconds')
time.sleep(1)
s+=1
if s==60:
m+=1
s=0
-
import sys
import os
import time
import datetime
current_time = datetime.datetime.now().time()
current_time = str(current_time)
current_time = current_time[:-7]
print(current_time)
if current_time = #set-the-time:
#Do something
However the top timer requires the system to sleep. Therefore if I were to implement this in a Maths Test Program, the user will not be able to input any data or perform any actions because the system continuously sleeps. Also when using the second method, again I would have to create some sort of while loop so that a signal/alert is passed when the time limit is reached, but again this will make the system freeze. Is there any way I could implement some sort of timer which allows the program to be run simultaneously???