Wraps a function call with memory usage monitoring, reporting memory usage
before, during, and after execution.
Usage
mem_monitor(fn, interval = 1, ...)
Arguments
- fn
Function to execute
- interval
Time interval in seconds for memory checks during execution
- ...
Arguments passed to fn
Value
Result of fn with memory usage statistics as an attribute