at the start and end of my program, I have
from time import strftime
print int(strftime(\"%Y-%m-%d %H:%M:%S\")
Y1=int(strftime(\"%Y\"))
m1=int(strftime(\
The datetime module will do all the work for you:
>>> import datetime
>>> a = datetime.datetime.now()
>>> # ...wait a while...
>>> b = datetime.datetime.now()
>>> print(b-a)
0:03:43.984000
If you don't want to display the microseconds, just use (as gnibbler suggested):
>>> a = datetime.datetime.now().replace(microsecond=0)
>>> b = datetime.datetime.now().replace(microsecond=0)
>>> print(b-a)
0:03:43