Closed Chen-Cai-OSU closed 3 years ago
Well this is absolutely a great feature, and it's quite straightforward to implement that.
Actually the profile
API follows the style from line_profiler
so I did not made any change to that.
By now we have an enabled
option in profiler
but the profiler will still prints the profiling results with this option set to False
.
However you can monkey patch the profile
function to a no-op like:
profile = lambda a:a
Hope it helps.
That's great! Thank you so much!
Hello,
This is probably a naive question. I would like to turn on and off the decorator without commenting things out. What would be an elegant way to achieve this? I have something like the following in mind but I don't know how to achieve this. Would you like to share some thoughts on this? Many thanks!