Timer Python 3,3
I was wondering how I would make my time in Python 3.3 display in minutes and seconds. At the minute, it only displays in seconds? Many Thanks.
start_time=time.time()
# program operation
end_time=time.time()-start_time
print(end_time)
Solution 1:
You can use the datetime
module
import datetime
end_time = 400 # this is the difference in your example, in seconds
str(datetime.timedelta(seconds = end_time))
Result
'0:06:40'