开发者

is there an easy way to log the amount of time visual studio 2010 spends building?

开发者 https://www.devze.com 2023-02-17 12:07 出处:网络
We would like to automatically log the time we spend building our project every day, while devving. Builds can be initiated by pressing f5, or runnning our n-unit tests with TestDriven.Net. We want th

We would like to automatically log the time we spend building our project every day, while devving. Builds can be initiated by pressing f5, or runnning our n-unit tests with TestDriven.Net. We want the entire combined time of building, not just for one or 2 projects. We want to do this to compare the impact on productivity of a slow pc versus a fast pc. Any ideas?

Update: I've investigated MSBuild loggers. This seems like it could work开发者_高级运维, but I can't figure out how to send parameters to MSBuild when we do an f5 build from VS.


VSCommands for Visual Studio 2010 and 2012 is available from Visual Studio Gallery can produce detailed build statistics in output window after the build is finished:

is there an easy way to log the amount of time visual studio 2010 spends building?


Tools + Options, Projects and Solutions, Build and Run. Change the MSBuild project build output verbosity setting to Normal. You'll get a Time Elapsed measurement at the end of the build. You can turn this setting to 11 to get a detailed breakdown. Build log output is automatically saved to the buildlog.htm file in the project's build directory.

The equivalent command line option is /verbosity:normal (/v:n). You can get output logged to a file with redirection or the /fileLogger option (/fl). Type msbuild /? to get a summary of these options, there are a bunch more obscure ways to log.


In the project output directory there is a project_name.log file with the line

"Time Elapsed 00:00:00.00"

You can parse this


You can use Tools | Options | Projects and Solutions | VC++ Project Settings | Build Timing to control whether that copy of Visual Studio includes timing in VC++ build output.

But that time and the Time Elapsed mentioned by @Martin appear in the Output window of Visual Studio when you do F5 builds and on the console when you do command line builds.

It sounds like you really want to collect the build times for several builds in one place. One place to start looking might be MSBuild Loggers.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号