Skip to content

Instantly share code, notes, and snippets.

@arijusg
Created March 4, 2022 17:26
Show Gist options
  • Save arijusg/b070d282f777cb59946b8d77912d576e to your computer and use it in GitHub Desktop.
Save arijusg/b070d282f777cb59946b8d77912d576e to your computer and use it in GitHub Desktop.
Python profiling
from timeit import default_timer as timer
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.INFO)
start = timer()
# my code
end = timer()
LOGGER.info(f"1: {(end - start)*1000}ms")
start = timer()
# my code
end = timer()
LOGGER.info(f"2: {(end - start)*1000}ms")
start = timer()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment