You can use valgrind to get memory usage and time to get cpu and time running information
for example
valgrind /bin/ls -lR /var > /dev/null
==24054== Memcheck, a memory error detector
==24054== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==24054== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==24054== Command: /bin/ls -lR /var
==24054==
==24054== HEAP SUMMARY:
==24054== in use at exit: 2,747,654 bytes in 59 blocks
==24054== total heap usage: 49,159 allocs, 49,100 frees, 27,671,387 bytes allocated
==24054==
==24054== LEAK SUMMARY:
==24054== definitely lost: 0 bytes in 0 blocks
==24054== indirectly lost: 0 bytes in 0 blocks
==24054== possibly lost: 0 bytes in 0 blocks
==24054== still reachable: 2,747,654 bytes in 59 blocks
==24054== suppressed: 0 bytes in 0 blocks
==24054== Rerun with --leak-check=full to see details of leaked memory
==24054==
==24054== For counts of detected and suppressed errors, rerun with: -v
time /bin/ls -lR /var > /dev/null
0.086u 0.199s 0:00.89 30.3% 0+0k 11784+0io 0pf+0w
time gives user, system, real, cpu%
Last edited by estabroo; 03-12-2014 at 08:38 AM.
Reason: removed formatting blocks
|