M*P 发帖数: 6456 | 1 用
$time ./myproject &
结果是
real 40m30.487s
user 31m3.504s
sys 0m28.169s
貌似后两个加起来跟第一个差8m
这是咋回事? |
S*A 发帖数: 7142 | 2 It is normal. Read the manual about what this time means.
【在 M*P 的大作中提到】 : 用 : $time ./myproject & : 结果是 : real 40m30.487s : user 31m3.504s : sys 0m28.169s : 貌似后两个加起来跟第一个差8m : 这是咋回事?
|
M*P 发帖数: 6456 | 3 没找到
【在 S*A 的大作中提到】 : It is normal. Read the manual about what this time means.
|
S*A 发帖数: 7142 | 4 sign. user is just time spend on user mode. sys is time spend on
kernel mode. real is the real clock time.
If your program is waiting for some thing(disk/network), or the
system is running some other task. The the time spend on user
is small than the real time.
real time == user time only happen when kernel pretty much only
schedule one process (taking 100% CPU) at the user space.
SMP is a different story, in SMP case you can see user time > real
time because running on two different processor.
【在 M*P 的大作中提到】 : 没找到
|