It had been always a pain point for developers to find out execution time, performance issues for different code block. Most of the time we Get time of Code Execution Using StopWatch , or other logging mechanism, profiler tool etc. However, they are time consuming and sometime does not add values to check for a single methods, smaller code segments. Visual Studio 2015 makes our life easier. Getting the performance information is now in your finger tip and you can inspect this information during debugging itself.
PerTips is enabled by default. So when you start debugging your app, you should be able to view the time elapsed . Run the application in debug mode, and step through the lines by F10. You should be to see the time elapsed during the execution of previous statement. You can also consider the right side simple code block just to understand the time elapsed part. As shown in the below code block, LoadIntialData() has a 1000 ms thread sleep. The next statement shows, how many milliseconds has been elapsed for overall method call.
If you mouse hover on the time elapsed, a tool tip message would display which say the total time taken for the execution and that’s also includes the debugging overhead.
On click of the Time Elapsed option, Visual Studio will open the Diagnostic Tool Window, where you can deep down to the internal events to see the details of time.
You really don’t need have breakpoint or step through all the line, you can easily jumped into end of the method, and see the total elapsed time between two break points of between code blocks.
As shown in the above image, you can see total time elapsed for the LoadIntialData() is 1,269 ms. And this time tool tip message is something different, which says, the time elapsed since previous breakpoints. Visual Studio is smart enough to identify the step by step execution or block executionexcution and display results accordingly.
To get more inside of PerfTip, Please Read this post.
Pingback: How To customize PerfTips Color in Visual Studio 2015 ?
Thanks Abhijit
Thanks for sharing. I think it’s the coolest feature in VS2015 we have. Do you think so?
Thanks Mate.
True. It is really a great feature ( have you checked this one too ? How To customize PerfTips Colors in Visual Studio 2015 ? .. . But there are many more.. I personally liked this one and debugging Lambda ( in watch windows, Immidiate window and also in DataTips.. ) . Please have a look into the new post .Debugging Lambda Expression in Visual Studio 2015 – Watch Windows, Immediate Windows and also in Data Tips
and let me know what you think.
Pingback: 10 New features of Visual Studio 2015 that you should know | Abhijit's World of .NET
Pingback: .NET Tips and Tricks from Daily .NET Tips – ( Visual Studio 2015, Windows Universal App Development, Microsoft Band, Xamarin ) – July 2015 Links | Abhijit's World of .NET
Pingback: Working with Live XAML in Windows Universal Apps and Visual Studio 2015
Pingback: Visual Studio – Developer Top Ten for August 5th, 2015 - Dmitry Lyalin