Last active
November 19, 2021 04:21
-
-
Save MaddoxRauch/431d1f3f2743c45173f1ccfd6ee16066 to your computer and use it in GitHub Desktop.
Just add import and class to python file, then you can use as a wrapper to functions using '@timetrack' to see how long it takes to execute. Or keep file separate and use 'from pyanal import TimeTrack' and use as wrapper.
This file contains hidden or 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 timeit | |
class TimeTrack: | |
def __init__(self, func): | |
start = timeit.default_timer() | |
func() | |
stop = timeit.default_timer() | |
print("Time to get %s" % (stop-start)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment