timed(func) decorating a function so it returns a tuple (result, elapsed_seconds) measured with time.perf_counter around the call. Discussion point: changing a function's return shape is invasive — real profilers log instead — but it makes the mechanics visible here.@timed applied to slow_add; slow_add(2, 3)
(5, 0.0001...)
The wrapper measured and bundled the timing.
Capture start before, subtract after.
Return (result, elapsed).