是否可以使用GCOV获得每行的执行时间?
是否可以用gcov获取每一行的执行时间? GCC有这样的编译选项吗?还有其他工具可以生成此类信息吗?
Is it possible to get the execution time of each line with gcov?
Does GCC have such a compilation option? Is any other tool which can generate such information?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 Valgrind 中运行相关代码,然后在 KCachegrind 中查看结果(附截图)。您可以看到注释的来源;它并不完美,但它可以完成工作。

You can run the code in question in Valgrind, then view the results in KCachegrind (screenshot attached). You can see the source annotated; it's not perfect, but it does the job.
