Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>EDIT: Here's a way you can write the build time <strong>directly to the build window</strong>.</p> <p>Open the Visual Studio Macro IDE.<br> Navigate to MyMacros > EnvironmentEvents.<br> Under MyMacros, add a reference to System.Windows.Forms (for the code below to show a popup window).<br> Add this code to the EnvironmentEvents module: </p> <pre><code>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 </code></pre> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload