使用gprof分析程序运行时间

gprof使用方法

要分析的文件如test.c

[shell]

gcc -pg test.c

./a.out

gprof -b ./a.out

[/shell]

[shell]
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
66.74 9.13 9.13 2 4.57 4.57 forf
33.26 13.68 4.55 main
0.00 13.68 0.00 1 0.00 0.00 s
[/shell]

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据