python - C++ 中的 Cprofile(Python)?

标签 python c++

在用 Python 编写代码时,我通常使用 Cprofile,它会在控制台中打印配置文件结果:

import cProfile, pstats, StringIO

pr = cProfile.Profile()
pr.enable()

#do stuff

pr.disable()
s = StringIO.StringIO()
ps = pstats.Stats(pr, stream=s).sort_stats('cumulative')
ps.print_stats()
print s.getvalue()

在 C++ 中是否有任何替代方案?

编辑 - 我使用的是 VS 2008 Express,Windows 64 位。

最佳答案

只需转到 Analyze -> Profiler -> Attach/Detach

关于python - C++ 中的 Cprofile(Python)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27261096/

相关文章:

python - 必须首先创建 wx.app 对象

c++ - vector 作为 HashMap 中的键值对

python - Tornado 重定向到带参数的页面

python - 通过boto3同步两个桶

python - Django Rest Framework RelatedField 无法返回字典对象

c++ - 在 C/C++ 的 ODBC 程序中找不到 SQL.H 和 SQLEXT.H

c++ - mysql_query 无法正确保存数据

c++ - 插入元素 (TinyXml)

c++ - 具有零行和 1000 列的矩阵?

使用 sleep 命令内联 Python 打印