visual-studio 在 Visual Studio 中测量总解决方案构建时间
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1640897/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Measuring total solution build time in Visual Studio
提问by Troy Hunt
Does any know if there is any native mechanism to report on the total solution build timein Visual Studio 2008? You can change the build verbosity to report build times per project as discussed hereor report total build time from msbuild but I'd like to see this in the IDE across an entire solution containing many projects. Short of creating custom pre and post build events, does anyone know if there's any native output for total build time? Thanks!
有谁知道是否有任何本地机制来报告Visual Studio 2008 中的总解决方案构建时间?您可以更改构建详细程度以报告每个项目的构建时间,如此处所述,或报告来自 msbuild 的总构建时间,但我希望在包含许多项目的整个解决方案的 IDE 中看到这一点。没有创建自定义的构建前和构建后事件,有谁知道总构建时间是否有任何本机输出?谢谢!
采纳答案by Troy Hunt
For the sake of completeness, the correct answer is "No, you can't report on total solution build time directly within Visual Studio".
为完整起见,正确答案是“不,您不能直接在 Visual Studio 中报告总解决方案构建时间”。
回答by splintor
Not native and not not for VS 2008 (currently only for VS 2010), but the VSCommands 2010 extensionprovides these statistics.
不是本机的,也不是 VS 2008 的(目前仅适用于 VS 2010),但VSCommands 2010 扩展提供了这些统计信息。
See also: VS 2010: Prevent display of Build Summary in the output window
回答by GraemeF
MSBuild will show the total build time when you run it from the command prompt, e.g:
当您从命令提示符运行 MSBuild 时,它将显示总构建时间,例如:
> msbuild MySolution.sln
...
Time Elapsed 00:00:36.94
回答by Pavel Vladov
There's also an easy way to measure the build time per project in Visual Studio 2010. I'm pretty sure it will work in Visual Studio 2008, too. All you have to do is to go to Tools -> Options -> Projects and Solutions -> Build and Runand set the MSBuild project build output verbosity to "Normal" or "Detailed" (I recommend "Normal", as detailed gives too much information).
还有一种在 Visual Studio 2010 中测量每个项目的构建时间的简单方法。我很确定它也适用于 Visual Studio 2008。您所要做的就是转到 工具 -> 选项 -> 项目和解决方案 -> 构建和运行并将 MSBuild 项目构建输出详细程度设置为“正常”或“详细”(我推荐“正常”,因为详细也给出了信息量很大)。
回答by mcintyre321
I think you could probably hook into the OnBuildBegin and OnBuildDone events
我想你可能会进入 OnBuildBegin 和 OnBuildDone 事件
http://visualstudiohacks.com/general/customize-your-project-build-process/
http://visualstudiohacks.com/general/customize-your-project-build-process/
回答by alocaly
In VC++2008, there is the "Build Timing' option in Tools / Options / Projects and solutions / VC++ Project Settings
在VC++2008中,工具/选项/项目和解决方案/VC++项目设置中有“Build Timing”选项

