免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2825 | 回复: 4
打印 上一主题 下一主题

看linux system programming的问题:关于times函数 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-20 17:05 |只看该作者 |倒序浏览
第10章,关于times: 获取当前进程的时间信息, 包括用户态时间, 核心态时间等等

返回的时间均以系统启动以来的时钟滴答计算.
====================
上面这句话看不懂。返回的时间应该是绝对时间,是当前进程使用的内核时间和用户时间,
怎么会是相对时间?

[ 本帖最后由 lovelypp 于 2008-5-20 17:19 编辑 ]

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
2 [报告]
发表于 2008-05-20 17:12 |只看该作者
〉〉返回的时间应该是绝对时间
为什么?

论坛徽章:
0
3 [报告]
发表于 2008-05-20 17:13 |只看该作者
对呀,为什么一定要是绝对时间呢……

论坛徽章:
0
4 [报告]
发表于 2008-05-20 17:18 |只看该作者
返回当前进程消耗的用户cpu时间和内核cpu时间,例如1分钟和3分钟,总不能说内核cpu使用了2008年05月20日吧
应该是多少多少个时钟滴答吧。

书上是这么写的:
The call returns the number of clock ticks,monotonically increasing, since an arbitrary point in the past. this reference point was once system
boot-thus, the times() function returned the system uptime, in ticks---but the reference point is now about 429 millio seconds before system boot.
真的是看不懂

论坛徽章:
0
5 [报告]
发表于 2008-05-21 18:37 |只看该作者
你说的这个叫时间段(timespan),不叫绝对时间。
而你说的意思,我覺得是你沒理解times函數……
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP