Loading...
Execution Timer Wrapper
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- staff
Problem
Our observability toolkit needs a non-invasive way to measure function execution times. Write a function called make_timed that wraps any function to print elapsed time after each call as 'Elapsed: X.XXXXs'. The wrapper must handle any combination of positional and keyword arguments.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.