Monitoring a Program's Resource Consumption

I am interested in determining how much memory and disk I/O a script consumes while it executes. Is there some type of utility that would provide this information in a way similar to time?

For example, I can run time myscript and get
Code:
real    0m0.105s
user    0m0.071s
sys     0m0.037s

Does anything exist that could do something like this:
# monitor myscript
Code:
memory     22,596 bytes
disk_read  5,994 bytes
disk_write 4,220 bytes
 
Back
Top