Visual Studio Profiling: Starting / Stopping Code

Is it possible to start / stop the visual studio profiler (Professional 2012+) from the code? I know that you can pause it, but to start profiling you need to click on the button in the visual studio.

In my case, I would like to launch it by clicking on a button in my application, which switches to a new view and automatically stops it when loading the user interface. I would like to know why there is such a big delay before the user interface appears.

+4
source share
1 answer

I haven't used it before, but it looks like you're looking for a profiling API .

DataCollection.StartProfile and DataCollection.StopProfile looks like the methods that interest you.

+3
source

Source: https://habr.com/ru/post/1570460/


All Articles