[20140627]time使用.txt
$ type -a time
time is a shell keyword
time is /usr/bin/time
--可以发现time有两个命令,1个是内置的,一个是外置的.
如果:
$ time ls -l /etc/passwd
-rw-r--r-- 1 root root 2874 2012-05-15 11:34:26 /etc/passwd
real 0m0.003s
user 0m0.001s
sys 0m0.002s
--如果要使用外部命令,可以使用:
$ /usr/bin/time -v ls -l /etc/passwd
-rw-r--r-- 1 root root 2874 May 15 2012 /etc/passwd
Command being timed: "ls -l /etc/passwd"
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 50%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
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): 0
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 252
Voluntary context switches: 2
Involuntary context switches: 1
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
也可以使用如下:
\time -v ls -l /etc/passwd
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-1195739/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/267265/viewspace-1195739/