I know we do some manual debugging from time to time. I got inspired from some Stack Overflow answers and blogposts to write this decorator
Now, you just need to import it in your code and write something like:
@measure
def foo:
some_large_computation()
Output:
Total execution time foo: 15 ms
If you want a smaller time unit, use 1000000
instead of 1000
factor to get microseconds (μ
)
I hope this can be any help.
Top comments (1)
Very useful! Thank you much for sharing!