How can i create a table to get compilation time of each c++ file in visual studio 2005 project.
+1
A:
"Tools" -> "Options" -> "Projects and Solutions" -> "VC++ Project Settings"
Tick "Build Timing".
Alex B
2009-07-10 10:53:06
Seriously, it's that easy? I still like my solution! :)
Greg Hewgill
2009-07-10 10:54:52
A:
It's been a while since I've used that version of the compiler, but I recall it prints the name of the file it's compiling to the console (when you use the command line build). If that's the case, then you can write a program that does the following:
- CreateProcess on the command line compiler, redirecting stdout to a pipe
- Read from the pipe, looking for source file names
- Each time a source file name is seen, note the current timestamp
- When the pipe is closed, print out the times taken for each file build
While this approach could be developed in C++, it would likely be easier to use a tool such as Perl to implement it.
Greg Hewgill
2009-07-10 10:54:24