Closed as not planned
Description
I'm learning about Python decorators and would appreciate feedback on my implementation.
Here's my example code:
@timer
def slow_function():
import time
time.sleep(2)
return "Done"
Specifically, I'd like to know:
- Is this a correct usage of decorators?
- What's missing from the implementation (I notice the
@timer
decorator itself isn't defined) - Best practices for implementing timing decorators
Thank you for your help!
Metadata
Metadata
Assignees
Labels
No labels