[Python-ideas] add a time decorator to timeit.py
Amjad Ben Hedhili
amjadhedhili at outlook.com
Sun Oct 7 06:16:08 EDT 2018
I think that a time decorator will be a useful addition to the sandard library, as i find the current way of measuring execution time a bit tedious:
timeit.timeit("fun_to_time(a, b)", setup="from __main__ import a, b", number=1)
compared to:
@timef
def fun_to_time(a, b):
...
or
timef(print)("Hello world!").
I already made a basic implementation of it, and it's working well.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20181007/b6744b14/attachment-0001.html>
More information about the Python-ideas
mailing list