time - 以 SCons 计算构建耗时

标签 time scons

我有一个项目,它由一个二进制文件和一组它所依赖的静态库组成。我正在尝试获取构建每个库所用的时间,但没有成功。

我曾尝试使用 AddPreAction()/AddPostAction()用于计算耗时,但 AddPreAction()一旦库所依赖的所有源文件都被编译(这是有道理的),就会调用它。

有一篇与此问题相关的帖子:

How can I measure the build time for each component of a scons build?

但我更愿意寻找更优雅的解决方案,而不是覆盖一些环境变量,然后必须解析输出以计算时间。

提前致谢。

最佳答案

您可以使用 --debug=time 获取有关构建各个不同方面的计时信息。 SCons 命令行选项,如 SCons man pages 中所述

这是摘录,您可以在上面提供的链接中阅读其余部分:

--debug=time
Prints various time profiling information: the time spent executing each 
individual build command; the total build time (time SCons ran from 
beginning to end); the total time spent reading and executing SConscript 
files; the total time spent SCons itself spend running (that is, not 
counting reading and executing SConscript files); and both the total 
time spent executing all build commands and the elapsed wall-clock 
time spent executing those build commands...

关于time - 以 SCons 计算构建耗时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15044345/

相关文章:

parsing - time.Parse 行为

ios - 为 iPhone 应用程序设置到期日期

time - 具有相同 GMT 偏移量的时区是否有任何不同?

python - Py_Initialize 抛出 ModuleNotFoundError : No module named 'encodings'

python - SCons 中 chdir=1 和 num_jobs>1 的组合

c++ - HLSL DirectX9 : Is there a getTime() function or similar?

cocoa-touch - iOS 中的准确计时

python - 如何使用 eclipse 和 pydev 调试 SCons 脚本?

compiler-errors - 在OSx 10.9 Mavericks上安装Cantera 2.1

Scons Install() 仅适用于 --install-sandbox