Skip to content

Instantly share code, notes, and snippets.

@ryanlong1004
Created March 29, 2022 18:54
Show Gist options
  • Save ryanlong1004/bacf565c70fd5d9476d3d03d8e85bd67 to your computer and use it in GitHub Desktop.
Save ryanlong1004/bacf565c70fd5d9476d3d03d8e85bd67 to your computer and use it in GitHub Desktop.
Easy python timing
import logging
import timeit
import time
def main():
start_time = timeit.default_timer()
# timed work here
time.sleep(1)
logging.info("finished in %s", (timeit.default_timer() - start_time) / 60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment