Created
February 25, 2021 03:09
-
-
Save rmporsch/7a92ce7bab0a6d29bd50f0a84db6faab to your computer and use it in GitHub Desktop.
[python performance evaluation] evaluates a python funciton
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 timeit | |
from functools import partial | |
def some_func(x): | |
pass | |
data = ["some_data"] | |
REPEATS = 3 | |
NUMBER = 1000 | |
times = timeit.Timer(partial(some_func, data)).repeat(REPEATS, NUMBER) | |
time_taken = min(times) / 10 | |
print(time_taken) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment