What is the proper way to compare 2 times in Python in order to speed test a section of code? I tried reading the API docs. I\'m not sure I understand the timedelta thing.>
I am not a Python programmer, but I do know how to use Google and here's what I found: you use the "-" operator. To complete your code:
from datetime import datetime
tstart = datetime.now()
# code to speed test
tend = datetime.now()
print tend - tstart
Additionally, it looks like you can use the strftime() function to format the timespan calculation in order to render the time however makes you happy.