Chinaunix首页 | 论坛 | 博客
  • 博客访问: 72109
  • 博文数量: 18
  • 博客积分: 406
  • 博客等级: 一等列兵
  • 技术积分: 187
  • 用 户 组: 普通用户
  • 注册时间: 2012-09-17 17:39
文章存档

2013年(2)

2012年(16)

我的朋友

分类: LINUX

2013-01-11 10:21:40

统计函数运行时间,在 《汇编语言程序设计》这本书里有介绍:

生成的文件用来查看   gprof ./test ./gmon.out

gprof OPTIONS EXECUTABLE-FILE gmon.out BB-DATA [YET-MORE-PROFILE-DATA-FILES...] [> OUTFILE]

gprof产生的信息
%                        the percentage of the total running time of the
time                     program used by this function.
                           函数使用时间占所有时间的百分比。
cumulative          a running sum of the number of seconds accounted
seconds             for by this function and those listed above it.
                           函数和上列函数累计执行的时间。
self                    the number of seconds accounted for by this
seconds             function alone. This is the major sort for this
                          listing.
                          函数本身所执行的时间。
calls                   the number of times this function was invoked, if
                          this function is profiled, else blank.
                          函数被调用的次数
self                   the average number of milliseconds spent in this
ms/call               function per call, if this function is profiled,
                         else blank.
                          每一次调用花费在函数的时间microseconds。
total                  the average number of milliseconds spent in this
ms/call               function and its descendents per call, if this
                          function is profiled, else blank.
                          每一次调用,花费在函数及其衍生函数的平均时间microseconds。
name                 the name of the function. This is the minor sort
                          for this listing. The index shows the location of
                          the function in the gprof listing. If the index is
                          in parenthesis it shows where it would appear in
                          the gprof listing if it were to be printed.

阅读(1618) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~