Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.cpp compile time tracking in Visual Studio 2012

I have to track compile time of each .cpp in every project. Default time-tracking in VS can't be used for it because this tool tracks time for projects, not for every .cpp.

Have you any ideas how to do this?

like image 471
MarkovDmitriy Avatar asked Jul 06 '26 14:07

MarkovDmitriy


1 Answers

This is actually not that difficult to do and is available in Visual Studio. It's an undocumented feature (figures....) but works nicely to report on individual compile times. Here's an example...

3>------ Build started: Project: SomeProject, Configuration: Debug x64 ------
3>  stdafx.cpp
3>  time(C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\c1xx.dll)=1.468s
3>  time(C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\c2.dll)=0.048s
3>  SortStringArray.cpp
3>  time(C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\c1xx.dll)=0.030s
3>  Registry.cpp
3>  time(C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\c1xx.dll)=0.026s
3>  PropertyRoot.cpp
3>  time(C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\c1xx.dll)=0.255s

To enable this feature, you need to add the undocumented compile switch /Bt to the C/C++ command line additional options for each project you'd like to track. For more information on what's available for timing, check out this VC++ Team Blog Post.

like image 153
rrirower Avatar answered Jul 08 '26 05:07

rrirower



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!