import datetime starttime = datetime.datetime.now() #long running endtime = datetime.datetime.now() print (endtime - starttime).seconds
import time start = time.time() #run code end = time.time() print end-start
import datetime starttime = datetime.datetime.now() #long running endtime = datetime.datetime.now() print (endtime - starttime).seconds
import time start = time.time() #run code end = time.time() print end-start