๐Ÿ”’Building Custom Context ManagersWORKSHOP
1
2
3
4
5

Step 1

Build a class-based `Timer` context manager. `__enter__` should record the start time using `time.perf_counter()` and return `self`. `__exit__` should print `'Elapsed: X.XXXs'` with 3 decimal places. Test it with a small computation.

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