Created
March 4, 2022 17:26
-
-
Save arijusg/b070d282f777cb59946b8d77912d576e to your computer and use it in GitHub Desktop.
Python profiling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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