gpt4 book ai didi

c# - Visual Studio 中是否有适用于 C# 的第三方分析工具?

转载 作者:行者123 更新时间:2023-11-30 19:47:34 27 4
gpt4 key购买 nike

我正在寻找一种工具来告诉我我的代码运行需要多长时间。这相当于在我的程序中的每一行代码之前和之后记录 DateTime.Now,然后显示每一行的两个时间之间的差异(在我的程序完成运行之后)。

例如,如果我有一个在其 main 中调用四个方法的程序,我想知道(在运行此工具之后)每个方法需要多长时间运行,然后如果我进入每个方法,我' d 想知道其中的每一行需要运行多长时间,等等。

这些工具存在吗?当然,我更喜欢免费的,但如果所有现有的都是专业工具,那么也请一并提及。

编辑:这些工具似乎被称为分析工具。谢谢,这肯定会帮助我进行搜索。不幸的是,我使用的是 Visual Studio 2010 Professional,所以我相信 Microsoft 分析工具不在我的掌握范围内。有什么好的第三方分析工具吗?

最佳答案

您可以使用 CLR Profiler for .NET Framework 4

The CLR Profiler includes a number of very useful views of the allocation profile, including a histogram of allocated types, allocation and call graphs, a time line showing GCs of various generations and the resulting state of the managed heap after those collections, and a call tree showing per-method allocations and assembly loads.

还有更多 profilers and tools can be found here ...

关于分析的更多信息 on the wikipedia

关于c# - Visual Studio 中是否有适用于 C# 的第三方分析工具?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6588429/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com