c# - 如何找到一段代码的执行时间?

标签 c# visual-studio-2010 visual-studio-2012 ssms

C#代码

  1. 能否在visual studio中找到一组代码的执行时间

  2. 如果 visual studio 确实为此提供了任何工具,有哪些替代方案?

  3. 是否有任何免费可靠的工具可供下载?

SQL 服务器管理工​​作室

  1. 能否在SQL server Management studio中找到一组代码的执行时间

  2. 如果 SQL server Management studio 确实为此提供了任何工具,还有哪些替代方案?

  3. 是否有任何免费可靠的工具可供下载?

谢谢

最佳答案

对于 SSMS Query execution time in miliseconds in SQL Server Management Studio

如果您需要在 SQL Server Management Studio 中获取以毫秒为单位的查询执行时间,有一种简单的方法可以实现。

set statistics time on

-- your query 

set statistics time off

这将导致消息窗口中出现以下 lin:

SQL Server Execution Times: CPU time = 16 ms, elapsed time = 16 ms.

关于c# - 如何找到一段代码的执行时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22609860/

相关文章:

c++ - VS 2012 更改默认调试 'Working Directory'

c# - 如何将 Visual Studio 表单设计器用于其他窗口系统?

C# - 将编号附加到正在保存的文件

.net - ASP.net MVC 项目是否支持添加动态数据?

visual-studio-2010 - 将列表模板 STP 文件导入到 Visual Studio 2010

visual-studio-2012 - 如何创建发布配置?

c# - 使用 C# 或 javascript 比较两个字符串数组

c# - PayPal 日期时间 (payment_date) 解析问题

visual-studio - Visual Studio 2010 : move and rename project item in the project hierarchy

.net - 发布项目时无法读取状态文件 "obj\Debug\Helpers.csprojResolveAssemblyReference.cache"错误