add better timing functionality with the datetime library
This commit is contained in:
parent
75514a194f
commit
9075fc3c8d
@ -1,5 +1,6 @@
|
|||||||
import sympy as sp
|
import sympy as sp
|
||||||
import time
|
import time
|
||||||
|
import datetime
|
||||||
import random
|
import random
|
||||||
import readline
|
import readline
|
||||||
|
|
||||||
@ -164,7 +165,7 @@ def practice(t) :
|
|||||||
# increment count
|
# increment count
|
||||||
count += 1
|
count += 1
|
||||||
# print success message
|
# print success message
|
||||||
print("Correct! You have solved", count, "problems in %.2f seconds" %tictoc)
|
print("Correct! You have solved", count, "problems in", str(datetime.timedelta(seconds=round(tictoc))))
|
||||||
break
|
break
|
||||||
else :
|
else :
|
||||||
# print failure message
|
# print failure message
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user