开发者

Visual Studio Macro - Logging Timestamps on Solution opens, closes, builds, etc

I've got a solution that takes a while to open. (5 minutes) Due to our processes and procedures I'm constantly jumping around between different branches of the same solution. I'm constantly closing and loading different variations of the same solution more than a few times a day. That's over 15 minutes - 30 minutes wasted just wating for my Visual Studio. I'm blaming the outdated computer hardware as the culprit. I want to capture metrics of how long solutions are taking to load as well as how long build times are taking. My goal is to present these metrics to management.

I'm using Visual Studio Macros to track this information.

As it stands right now I'm logging time stamps on these three events EnvDTE.SolutionEvents.BeforeClosing, EnvDTE.SolutionEvents.AfterClosing, EnvDTE.SolutionEvents.Opened.

The problem is, the SolutionEvents.Opened fires after the entire solution has been loaded. I need to generate a timestamp from when I start to load the solution and when it finishes.

How开发者_JAVA技巧 can I find out when Visual Studio starts loading the solution? So that I can compare it to when it finished loading.

Below is my code (My LogWithTimeStamp() function just writes the string to a file with the current timestamp as a prefix:

Private Sub SolutionEvents_BeforeClosing() Handles SolutionEvents.BeforeClosing
    LogWithTimeStamp("SolutionEvents.BeforeClosing")
End Sub

Private Sub SolutionEvents_AfterClosing() Handles SolutionEvents.AfterClosing
    LogWithTimeStamp("SolutionEvents.AfterClosing")
End Sub

Private Sub SolutionEvents_Opened() Handles SolutionEvents.Opened
    LogWithTimeStamp("SolutionEvents.Opened")
End Sub
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜