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# 中分析方法以了解运行需要多长时间


- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 输入按键事件处理程序 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04