Skip to content

Instantly share code, notes, and snippets.

@kleysonr
Created March 11, 2019 21:57
Show Gist options
  • Save kleysonr/eb4f4f3bb71459ade369173a31552196 to your computer and use it in GitHub Desktop.
Save kleysonr/eb4f4f3bb71459ade369173a31552196 to your computer and use it in GitHub Desktop.
Python time execution
import time
start_time = time.time()
(...)
end_time = time.time()
hours, rem = divmod(end_time-start_time, 3600)
minutes, seconds = divmod(rem, 60)
logger.info('Finished in {:0>2}:{:0>2}:{:05.2f}'.format(int(hours),int(minutes),seconds))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment