VS2010事件探查器:是否可以探查一种特定的方法? [英] VS2010 profiler : is it possible to profile one specific method?

查看:87
本文介绍了VS2010事件探查器:是否可以探查一种特定的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能有一些方法可以打开和关闭代码分析?

Possibly some methods to turn on and turn off profiling from code?

或者您可以选择要配置的特定功能吗?

Or can you select a specific function to profile ?

推荐答案

您还可以使用探查器的数据收集API来启动和停止对您感兴趣的方法进行性能分析.请参见

You can also use the profiler's data collection API to start and stop profiling around the methods you're interested in. See this MSDN article for a walkthrough.

在这种情况下,使用API​​的最佳方法是在方法执行之前调用StartProfile,然后在执行方法之后调用StopProfile.您应该通过开始使用已暂停的分析"选项来开始分析,这样才能在您第一次拨打StartProfile之前开始进行分析.

The best way to use the API in this case would be to call StartProfile just before your methods execute and then call StopProfile just after. You should start profiling via the "Start With Profiling Paused" option so you don't start profiling until you hit the first call to StartProfile.

使用数据收集API可以配合采样或检测.

Using the data collection API will work with sampling or instrumentation.

这篇关于VS2010事件探查器:是否可以探查一种特定的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆