In Python 3.x I want to measure the time it takes to execute an operation and print it in the format DD:HH:MM:SS.SSS (pref with the decimals to include milliseconds). Looking around I couldn't find specifically what I am after in this case on the internet.
My code looks like the following at the moment:
import time
t = time.time()
# perform an operation
t = time.time() - t
print('Elapsed time: ' + str(t))
Obviously I am getting everything in seconds and i can't quite get how to use the formatting function on variable t to get exactly what I am after.