Created
March 29, 2022 18:54
-
-
Save ryanlong1004/bacf565c70fd5d9476d3d03d8e85bd67 to your computer and use it in GitHub Desktop.
Easy python timing
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
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