답변:
아이러니하게도 time답이 될 수 있지만 이번에는 쉘 내장이 time아니라 독립형 이어야합니다 .
$ /usr/bin/time -v uname
Linux
Command being timed: "uname"
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 2%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.12
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 896
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 1
Minor (reclaiming a frame) page faults: 304
Voluntary context switches: 3
Involuntary context switches: 3
Swaps: 0
File system inputs: 56
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
VSS가 아닌 MAX RSS를 계산하므로 유용 할 것입니다.
UPD. : 맥 OS X는 ' "생각"약간 다르지만 여전히입니다 time:
/usr/bin/time -l /Applications/Opera.app/Contents/MacOS/Opera
244.63 real 54.34 user 26.44 sys
284827648 maximum resident set size
0 average shared memory size
0 average unshared data size
0 average unshared stack size
711407 page reclaims
1272 page faults
0 swaps
155 block input operations
251 block output operations
98542 messages sent
68330 messages received
16 signals received
699 voluntary context switches
468999 involuntary context switches
bash나 zsh맨 페이지 에서는 이것을 언급하지 않습니다. 당신은 그것을 혼동하고 times있습니까?
for SH in zsh bash dash; do $SH -c 'echo $0; type time'; done — zsh 시간은 예약어입니다 — bash 시간은 쉘 키워드입니다 – 대시 시간은 / usr / bin / time
/usr/bin/time시스템 호출의 상단에 크게 구축 wait3또는 wait4(내가 정확히 기억하지 않는다), 그것은 쉽게있을뿐만 아니라 행동으로 넣을 수 있습니다.
valgrind이것을 위해 사용할 수 있습니다 :
$ valgrind myprogram arg1 arg2
출력에는 관련이없는 내용이 많이 있지만 힙 요약은 원하는 것을 수행합니다.
==91383== HEAP SUMMARY:
==91383== in use at exit: 157,643 bytes in 364 blocks
==91383== total heap usage: 2,999 allocs, 2,635 frees, 306,450 bytes allocated
valgrind안드로이드 용 포트가있는 것처럼 보입니다. 나는 그것을 시도하고 설치할 것입니다.
time(1)있습니까?