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(\
You cannot calculate the differences separately ... what difference would that yield for 7:59 and 8:00 o'clock? Try
import time
time.time()
which gives you the seconds since the start of the epoch.
You can then get the intermediate time with something like
timestamp1 = time.time()
# Your code here
timestamp2 = time.time()
print "This took %.2f seconds" % (timestamp2 - timestamp1)