13

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!

Danra
  • 9,546
  • 5
  • 59
  • 117
  • What do you mean by "how much time spent on building.."? Do you mean from the time you started clicking "build" to the time it completed (regardlesssuccessful or not)? – o.k.w Nov 08 '09 at 10:35

3 Answers3

14

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
Justin R.
  • 23,435
  • 23
  • 108
  • 157
  • 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 Nov 15 '09 at 20:26
  • 2
    Found the answer myself. http://msdn.microsoft.com/en-us/library/ms404301.aspx Thanks! – Danra Nov 15 '09 at 20:28
3

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
  • 14,639
  • 11
  • 62
  • 110
  • 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 Nov 08 '09 at 11:17
  • 1
    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 Nov 08 '09 at 12:08
0

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
  • 8,001
  • 14
  • 49
  • 78
  • 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 Nov 11 '09 at 13:28