Is there a way to measure how much an executed terminal command/operation used memory, like the built-in command time
for measuring execution time. I'd like to compare commands with different parameters.
Asked
Active
Viewed 1,125 times
6

Tom Smith
- 331
- 4
- 14
-
http://stackoverflow.com/a/774601/524743 – Samuel May 30 '16 at 09:36
2 Answers
12
I was looking for something like this.
This is how I used it:
$/usr/bin/time -f "%E %M" *<command>*
That gave me:
time (%E) - elapsed real time (in [hours:]minutes:seconds);
memory (%M) - maximum resident set size of the process during its lifetime, in kB.

Billal Begueradj
- 20,717
- 43
- 112
- 130

Tom Smith
- 331
- 4
- 14