Skip to content

Commit ec28c05

Browse files
Add time elapsed
1 parent 356aeca commit ec28c05

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

main.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# Import Statements
1212
import subprocess
13-
from datetime import datetime, date
13+
from datetime import datetime
1414
import time
1515

1616
# Workout Lists
@@ -113,6 +113,8 @@ def openvideo():
113113
elif activity.lower() == "start":
114114
global activity_num
115115
activity_num = 0
116+
global start
117+
start = datetime.now()
116118
print("You have started the " + select + " muscle group. ")
117119
print("The current time is: " + str(time.strftime("%H:%M:%S")))
118120
if select == "abs":
@@ -140,10 +142,11 @@ def openvideo():
140142
activity_num = activity_num + 1
141143
run_activity = True
142144
elif activity.lower() == "next":
143-
while (activity_num-1) <= len(select)+1:
144-
print("You are in the " + select + " muscle group. ")
145-
print("The current time is: " + str(time.strftime("%H:%M:%S")))
146-
if select == "abs":
145+
now = datetime.now()
146+
print("You are in the " + select + " muscle group. ")
147+
print("The current time is: " + str(time.strftime("%H:%M:%S")) + ". " + str(now-start) + " has elapsed.")
148+
if select == "abs":
149+
if activity_num < 6:
147150
print("You have completed: " + str((int(activity_num/len(abs_count)*100))) + "%")
148151
print("Please complete 2 Sets of " + str(abs_count[activity_num]) + " Reps of " + str(abs[activity_num]) + "\n")
149152
elif select == "quads":

0 commit comments

Comments
 (0)