๐Ÿ”จBuilding Custom DecoratorsWORKSHOP
1
2
3
4
5

Step 1

Build a `timer` decorator that measures and prints how long a function takes to run. Use `time.perf_counter()` for precision. Apply it to a `slow_add(a, b)` function that sleeps 0.1 seconds and returns `a + b`. Use `@functools.wraps` to preserve metadata.

โŒ˜ Enter (Mac) ยท Ctrl+Enter (Win/Linux)