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# 中分析方法以了解运行需要多长时间
基础教程推荐
- Moq It.Is<>不匹配 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
