timeit equivalent #552
Answered
by
superlopuh
superlopuh
asked this question in
Q&A
-
What's the best way to time the time to execute a function, like import timeit
def one():
return 1
timeit.repeat("one()", "from __main__ import one", number=100000) |
Beta Was this translation helpful? Give feedback.
Answered by
superlopuh
Jan 13, 2024
Replies: 1 comment 1 reply
-
Oh this seems to work: import timeit
def bla():
return 1
timeit.repeat("bla()", globals=globals()) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
akshayka
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh this seems to work: