import time startTime = time.time() endTime = time.time() - startTime
>>> import datetime >>> a = datetime.datetime.now() >>> # ...wait a while... >>> b = datetime.datetime.now() >>> print(b-a) 0:03:43.984000