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# 中分析方法以了解运行需要多长时间
基础教程推荐
- 获取C#保存对话框的文件路径 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- 从 C# 控制相机设备 2022-01-01
- 如果条件可以为空 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 将数据集转换为列表 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
