I\'m just trying to time a piece of code. The pseudocode looks like:
start = get_ticks()
do_long_code()
print \"It took \" + (get_ticks() - start) + \" secon
import datetime
start = datetime.datetime.now()
do_long_code()
finish = datetime.datetime.now()
delta = finish - start
print delta.seconds
From midnight:
import datetime
midnight = datetime.datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
now = datetime.datetime.now()
delta = now - midnight
print delta.seconds