Skip to content

Commit 307e07a

Browse files
committed
Update SimpleStopWatch.py
Added a live time counter display to stopwatch (updates every second)
1 parent 2b999ee commit 307e07a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

SimpleStopWatch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
input() # For ENTER. Use raw_input() if you are running python 2.x instead of input()
1010
starttime = time.time()
1111
print('Started')
12+
while True:
13+
print('Time Elapsed: ', round(time.time() - starttime, 0), 'secs', end="\r")
14+
time.sleep(1)
1215
except KeyboardInterrupt:
1316
print('Stopped')
1417
endtime = time.time()

0 commit comments

Comments
 (0)