-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer.py
More file actions
33 lines (23 loc) · 796 Bytes
/
timer.py
File metadata and controls
33 lines (23 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import time
starttime=time.time()
lasttime=starttime
lapnum=1
print("Her ENTER = 1 Tur \nCTRL+C ile program kapanir.")
try:
while True:
input()
laptime=round((time.time() - lasttime), 2)
# Başlangıçtan beri geçen toplam süre.
totaltime=round((time.time() - starttime), 2)
# Tur sayısını printler,
# Tur süresi ve toplam süre.
print("Tur Sayısı "+str(lapnum))
print("Toplam Süre: "+str(totaltime))
print("Tur Süresi: "+str(laptime))
print("*"*20)
# Toplam süre ve tur sayısını günceller.
lasttime=time.time()
lapnum+=1
# CTRL+C basarsanız:
except KeyboardInterrupt:
print("Tur Sayaci kapatildi.")