User CPU , System CPU, Clock time什么区别?

zhangxichao 2008-10-25 10:43:26
在看unix环境高级编程时,Figure 3.5中列出了程序在不同情况下的执行时间,不明白其中各列代表什么含义:
1. Use CPU(seconds) 2. System CPU(seconds) 3. Clock CPU(seconds) 4.#loops
希望高人指点
...全文
373 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangxichao 2008-10-26
  • 打赏
  • 举报
回复
thanks
blf0 2008-10-26
  • 打赏
  • 举报
回复
可以参见 TIME 手册
man time

TIME(1) TIME(1)

NAME
time - time a simple command or give resource usage

SYNOPSIS
time [options] command [arguments...]

DESCRIPTION
The time command runs the specified program command with the given arguments. When command finishes, time writes a message to standard output giving timing statistics
about this program run. These statistics consist of (i) the elapsed real time between invocation and termination, (ii) the user CPU time (the sum of the tms_utime and
tms_cutime values in a struct tms as returned by times(2)), and (iii) the system CPU time (the sum of the tms_stime and tms_cstime values in a struct tms as returned by
times(2)).

OPTION
-p When in the POSIX locale, use the precise traditional format
"real %f\nuser %f\nsys %f\n"
(with numbers in seconds) where the number of decimals in the output for %f is unspecified but is sufficient to express the clock tick accuracy, and at least one.

ENVIRONMENT
The variables LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, LC_NUMERIC, NLSPATH and PATH are used. The last one to search for command. The remaining ones for the text and for-
matting of the output.

EXIT STATUS
If command was invoked, the exit status is that of command. Otherwise it is 127 if command could not be found, 126 if it could be found but could not be invoked, and
some other nonzero value (1-125) if something else went wrong.

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧