Skip to content

Instantly share code, notes, and snippets.

@rmporsch
Created February 25, 2021 03:09
Show Gist options
  • Save rmporsch/7a92ce7bab0a6d29bd50f0a84db6faab to your computer and use it in GitHub Desktop.
Save rmporsch/7a92ce7bab0a6d29bd50f0a84db6faab to your computer and use it in GitHub Desktop.
[python performance evaluation] evaluates a python funciton
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