Skip to content

Commit 22e34cb

Browse files
Add files via upload
create stop watch in python
1 parent 99cf7d7 commit 22e34cb

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

create stop watch.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import time
2+
def convert_time(sec):
3+
min = sec // 60
4+
sec = sec % 60
5+
hrs = min // 60
6+
min = min % 60
7+
print("Lapsed Time = {0}:{1}:{2}".format(int(hrs),int(min),sec))
8+
input("Press Enter to start")
9+
start_time = time.time()
10+
input("Press Enter to stop")
11+
end_time = time.time()
12+
lapsed_time = end_time - start_time
13+
convert_time(lapsed_time)

0 commit comments

Comments
 (0)