views:

265

answers:

3

Hi,

I'm interested in how much time I am spending on building my projects every day. Is there any existing tool which provides such statistics?

Thanks!

+3  A: 

There is build event, you can use them, you can also run a batch script before and after a build to echo time >> filename

and then render the file and get your stats.

(goto build events in the project property page)

Dani
I know I can script it, I was asking if there is an *existing* tool/script which I can use, preferrably integrated into the IDE...
Danra
I guess one can write a build task and plug it in to the environment, but I don't know about one that calculates build times.I'll look around, codeproject might have something.
Dani
A: 

If you were to use continuous integration tools like Cruise or Cruise.NET, these tools do a very good job of showing metrics like build times, average build times etc.

Ritesh M Nayak
This would actually defeat the purpose since I am interested in how much *interactive* time goes to waste - that is, builds I perform manually to test changes in the code.I don't really know Cruise Control though so perhaps I am missing some of its capabilities.
Danra
+3  A: 

MSBuild (what VisualStudio uses to build) can provide you with this information. Include in your msbuild.exe call the PerformanceSummary switch:

msbuild.exe your.sln /clp:PerformanceSummary ...

That will give you something like this at the end of your build run log:

Project Performance Summary:
      374 ms  your.sln  1 calls

Target Performance Summary:
...
      109 ms  GetWinFXPath                               1 calls
      156 ms  EntityDeploy                               1 calls
      390 ms  Build                                      2 calls
...
Time Elapsed 00:00:00.43

If you want a file that contains only this information, rather than having it written to your console, you can use this switch (with logfile set to some path):

/logger:FileLogger,Microsoft.Build.Engine;logfile=perf.log;encoding=Unicode;performancesummary
fatcat1111
Great answer!Is there anyway to change the msbuild.exe parameters in the visual studio IDE? I suppose I could replace the original msbuild.exe with a script which runs the original msbuild.exe with some parameters, but there must be a cleaner way?
Danra
Found the answer myself.http://msdn.microsoft.com/en-us/library/ms404301.aspxThanks!
Danra