Added total time
Wrote time format function