Skip to content

Commit c2bdb8c

Browse files
committed
Stopwatch Script
1 parent ccfb540 commit c2bdb8c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

SimpleStopWatch.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#Author: OMKAR PATHAK
2+
#This script helps to build a simple stopwatch application using Python's time module.
3+
4+
import time
5+
6+
print('Press ENTER to begin, Press Ctrl + C to stop')
7+
while True:
8+
try:
9+
input() #For ENTER
10+
starttime = time.time()
11+
print('Started')
12+
except KeyboardInterrupt:
13+
print('Stopped')
14+
endtime = time.time()
15+
print('Total Time:', round(endtime - starttime, 2),'secs')
16+
break

0 commit comments

Comments
 (0)