I know there is a way to display the build time of each project contained in a solution in visual studio. But what I'm looking for is the total time it took to build an entire solution, from the moment I clicked on build, to the moment it was done.
Is there anyway to do this ? Running Visual Studio 2008.
Go to Tools → Options → Projects and Solutions → Build and Run → MSBuild project build output verbosity - set to "Normal" or "Detailed", and the build time will appear in the output window.
Build Solution - compiles code files (dll and exe) that have changed. Rebuild Solution - Deletes all compiled files and Compiles them again regardless of whether or not the code has changed.
Choose Clean All to delete any intermediate and output files. With only the project and component files left, new instances of the intermediate and output files can then be built.
Build and run your code in Visual Studio To build your project, choose Build Solution from the Build menu. The Output window shows the results of the build process. To run the code, on the menu bar, choose Debug, Start without debugging. A console window opens and then runs your app.
Visual Studio Build Timer. Times the build of your Visual Studio solution and shows how much time is spent building each project. Open the tool window from the top menu View -> Other Windows -> Build Timer. Start building your Visual Studio solution.
To build, rebuild, or clean an entire solution. In Solution Explorer, choose or open the solution. On the menu bar, choose Build, and then choose one of the following commands: Choose Build or Build Solution to compile only those project files and components that have changed since the most recent build. Note.
Go to Tools → Options → Projects and Solutions → Build and Run → MSBuild project build output verbosity - set to "Normal" or "Detailed", and the build time will appear in the output window. Show activity on this post. Click Tools -> Options and then select Projects and Solutions -> Build and Run .
Start building your Visual Studio solution. Build Timer records time spent building each project and creates a timeline presented as a bar chart. The timeline allows you to see: the projects that take longer to build
EDIT: Here's a way you can write the build time directly to the build window.
Open the Visual Studio Macro IDE.
Navigate to MyMacros > EnvironmentEvents.
Under MyMacros, add a reference to System.Windows.Forms (for the code below to show a popup window).
Add this code to the EnvironmentEvents module:
Dim buildStart As Date
Private Function IsBuild(ByVal scope As EnvDTE.vsBuildScope, ByVal action As EnvDTE.vsBuildAction) As Boolean
Return scope = vsBuildScope.vsBuildScopeSolution AndAlso (action = vsBuildAction.vsBuildActionBuild OrElse action = vsBuildAction.vsBuildActionRebuildAll)
End Function
Private Sub BuildEvents_OnBuildBegin(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildBegin
If (IsBuild(Scope, Action)) Then
buildStart = Date.Now
End If
End Sub
Private Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildDone
If (IsBuild(Scope, Action)) Then
Dim buildTime = Date.Now - buildStart
WriteToBuildWindow(String.Format("Build time: {0}", buildTime.ToString))
End If
End Sub
Private Sub WriteToBuildWindow(ByVal message As String)
Dim win As Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
Dim ow As OutputWindow = CType(win.Object, OutputWindow)
For Each owPane As OutputWindowPane In ow.OutputWindowPanes
If (owPane.Name.Equals("Build")) Then
owPane.OutputString(message)
Exit For
End If
Next
End Sub
When you build or rebuild the full solution, at the end, the build/rebuild duration will be printed to the build output window. You can change the conditions in IsBuild to suit your preferences.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With