存档
文章标签 ‘Time’
09/11 05
没有评论
328 次查看
在linux中存在两个time,一个是bash的命令,另外一个是程序/usr/bin/time,bash的time命令只能很简单的显示程序执行的时间,而/usr/bin/time程序可以显示很详细的与IO相关的数据,比如从内存中读取了多少数据,从磁盘中读取了多少数据之类的,以及文件系统的页大小。
通过type命令我们可以看到Linux中的两个time
oracle@linux[]:~
$type -a time
time is a shell keyword
time is /usr/bin/time
$type -a time
time is a shell keyword
time is /usr/bin/time
bash中的time示例
oracle@linux[]:~
$time echo test
test
real 0m0.000s
user 0m0.000s
sys 0m0.000s
$time echo test
test
real 0m0.000s
user 0m0.000s
sys 0m0.000s
bash中的time命令只能显示你程序的执行时间,包括实际执行时间,用户时间和系统时间,除此之外没有其他的信息。
阅读全文…
本文采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议发布,转载请保留此信息
作者:马齿苋 | 链接:http://www.dbabeta.com/2009/time-command-in-linux.html
作者:马齿苋 | 链接:http://www.dbabeta.com/2009/time-command-in-linux.html
近期评论