time 和 times

sh/bash/dash/ksh/zsh等Shell脚本
回复
crossie
帖子: 241
注册时间: 2008-05-25 20:35

time 和 times

#1

帖子 crossie » 2008-07-16 23:34

time的输出
real 0m0.384s
user 0m0.268s
sys 0m0.076s
是什么意思?

times的输出
0m0.176s 0m0.016s
0m0.980s 0m0.268s
又是什么意思?

谢谢
头像
bones7456
帖子: 8495
注册时间: 2006-04-12 20:05
来自: 杭州
联系:

#2

帖子 bones7456 » 2008-07-17 9:03

time的输出
real 0m0.384s 实际时间
user 0m0.268s CPU 在用户模式下执行的秒数。
sys 0m0.076s CPU 在系统模式下执行的秒数。

times没用过.
关注我的blog: ε==3
crossie
帖子: 241
注册时间: 2008-05-25 20:35

#3

帖子 crossie » 2008-07-28 15:16

bones7456 写了:time的输出
real 0m0.384s 实际时间
user 0m0.268s CPU 在用户模式下执行的秒数。
sys 0m0.076s CPU 在系统模式下执行的秒数。

times没用过.
应该是

代码: 全选

“user”时间这一项给出的是进程运行所花的实际时间。另外两列,“real”和“sys”,记录了进程活了多长时间(包括其他进程使用的CPU的时间)和等待操作系统调用所花时间。
头像
alinmn
帖子: 185
注册时间: 2006-05-19 21:42
来自: NIT

#4

帖子 alinmn » 2008-07-28 17:54

man bash
...
times Print the accumulated user and system times for the shell and for processes run from the shell.
回复