-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer.py
More file actions
49 lines (45 loc) · 1.1 KB
/
timer.py
File metadata and controls
49 lines (45 loc) · 1.1 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import time
def timer25():
#25 minute timer
t=25*60
print("Time left to work: ")
while t:
mins = t // 60
secs = t % 60
timer = '{:02d}:{:02d}'.format(mins, secs)
print(timer, end="\r")
time.sleep(1)
t -=1
def s_break():
#5 minute break
t=5*60
print("Break time! Time to enjoy: ")
while t:
mins = t // 60
secs = t % 60
timer = '{:02d}:{:02d}'.format(mins, secs)
print(timer, end="\r")
time.sleep(1)
t -=1
def l_break():
#10 minute break
t=10*60
print("Break time! Time to enjoy: ")
while t:
mins = t // 60
secs = t % 60
timer = '{:02d}:{:02d}'.format(mins, secs)
print(timer, end="\r")
time.sleep(1)
t -=1
def test_timer():
#5 second timer for testing
t=5
print("Break time! Time to enjoy: ")
while t:
mins = t // 60
secs = t % 60
timer = '{:02d}:{:02d}'.format(mins, secs)
print(timer, end="\r")
time.sleep(1)
t -=1