Profiling a method in C# to know how long does it take to run(在 C# 中分析方法以了解运行需要多长时间)
问题描述
我需要获取时间报告以了解在类中运行 C# 方法需要多长时间.我考虑使用 profiler
来做到这一点.
I need to get a timing report to know how long does it take to run a C# method in a class.
I think about using profiler
to do that.
输入是类中方法的名称,输出是
The input is the name of a method in a class, the output is
- 什么方法/类调用这个方法.
- 运行方法的时间量.
Visual Studio 2010 和 Mono 有哪些工具/商业产品可用?
What tools/commercial products are available for that for Visual Studio 2010 and Mono?
推荐答案
另一个开源分析器是 slimtune http://code.google.com/p/slimtune/
Another opensource profiler is slimtune http://code.google.com/p/slimtune/
或者,您可以使用 COM 和 ICorProfilerCallback 接口创建自己的分析器,但如果您想要一个非常定制的分析器集合,我会这样做.
Alternatively you can create your own profiler using COM and the ICorProfilerCallback interfaces, but I would do this if you wanted a very customized profiler gathering.
这篇关于在 C# 中分析方法以了解运行需要多长时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 C# 中分析方法以了解运行需要多长时间


基础教程推荐
- 全局 ASAX - 获取服务器名称 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01