
import time
# Display the program's instructions.
print('Press ENTER to begin. Afterward, press ENTER to "click" the stopwatch. press Ctrl-C to quit')
input() #press Enter to begin
print('Started')
startTime = time.time() # get the lap's start time
lastTime  = startTime
lapNum = 1

try:
    while True:
        lapTime = round(time.time() - lastTime, 2)
        totalTime = round(time.time() - startTime, 2)
        print('lap#%s: %s(%s)'%(lapNum,totalTime,lapTime))
        lapNum +=1
        lastTime = time.time()#reset the last lap time.
except KeyboardInterrupt:
    # Handle the Ctrl-C exception to keep its error message from displaying.
    print('\nDone.')



