Chinaunix首页 | 论坛 | 博客
  • 博客访问: 250507
  • 博文数量: 65
  • 博客积分: 2599
  • 博客等级: 少校
  • 技术积分: 710
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-04 10:49
文章分类

全部博文(65)

文章存档

2015年(4)

2013年(2)

2012年(4)

2011年(51)

2010年(4)

分类: LINUX

2011-12-16 14:07:30

Program Time Information

wall clock time(时钟时间): the whole time of a process from start to end.
user CPU time(用户CPU时间): time of execute user instructions. 在用户空间的执行时间。
system CPU time(系统CPU时间): time of program executing in kernel routinue.在内核空间执行内核例程的时间。

These three kind of time is very high level for a process.
We can identify where our program spent most of time. Use time(1)
shell command to get them.

Note: If we want to get time spent of a function or something in this level,
we should use GNU Tools, like gprof.

Example:
$ cd /usr/include/
$ time grep -nri errno ./


real    0m5.571s
user    0m1.470s
sys    0m0.080s
阅读(636) | 评论(0) | 转发(0) |
0

上一篇:C 程序出错处理

下一篇:文件基本IO 操作

给主人留下些什么吧!~~