您的位置:首页 > 其它

real,user and sys 进程时间统计

2011-07-28 14:01 288 查看
在linux命令下,敲入time ls ,即可得到下面:[root@mail ~]# time ls
2.doc bak mail package
AdobePhotoshopCS4-11.0.1.rar index.html Maildir
amavisd.conf install.log main.cf
anaconda-ks.cfg install.log.syslog master.cfreal 0m0.003s
user 0m0.000s
sys 0m0.002sreal,就是整个运行这个进程从一开始到结束的整个时间(时钟墙)user,是指在运行这个进程中花在用户模式下的时间,即不包括内核的运行时间sys,是指在运行这个进程,花在内核调用的时间,而不是代码库调用user+sys=这个进程花的时间下面是网上下的出处
Real, User and Sys process time statisticsOne of these things is not like the other. Real refers to actual elapsed time; User and Sys refer to CPU time usedonly by the process.Real is wall clock time - time from start to finish of the call. This is all elapsed time including time slices used by other processes and time the process spends blocked (for example if it is waiting for I/O to complete).
User is the amount of CPU time spent in user-mode code (outside the kernel) within the process. This is only actual CPU time used in executing the process. Other processes and time the process spends blocked do not count towards this figure.
Sys is the amount of CPU time spent in the kernel within the process. This means executing CPU time spent in system calls within the kernel, as opposed to library code, which is still running in user-space. Like ‘user’, this is only CPU time used by the process. See below for a brief description of kernel mode (also known as ’supervisor’ mode) and the system call mechanism.
User+Sys will tell you how much actual CPU time your process used.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐