import time
from time import time as my_timer
import random

input("Press enter to start")

wait_time = random.randint(1,6)
time.sleep(wait_time)
start_time=my_timer()
input("press enter to stop")
end_time=my_timer()

print("Started at" + time.strftime("%X",time.localtime(start_time)))
print("Ended at" + time.strftime("%X",time.localtime(end_time)))
print("Your reaction time was {} seconds".format(end_time - start_time))



#############################################################################


import time
from time import monotonic as my_timer
import random

input("Press enter to start")

wait_time = random.randint(1,6)
time.sleep(wait_time)
start_time=my_timer()
input("press enter to stop")
end_time=my_timer()

print("Started at" + time.strftime("%X",time.localtime(start_time)))
print("Ended at" + time.strftime("%X",time.localtime(end_time)))
print("Your reaction time was {} seconds".format(end_time - start_time))


#perf_couter and monotonic are essentially the same but perf_counter has higher resolution


#process_time will give the elapsed time for the CPU to work on a process
