测量存储过程持续时间

发布于 2024-09-19 03:32:36 字数 147 浏览 3 评论 0原文

在我的应用程序中,我想知道存储过程的执行时间。 我的模式是执行读取器并获取数据读取器并读取结果。读者立即返回,不知道存储过程执行时间。 我不能将计时器放在读取器之后,因为我想要一个扩展方法来封装执行读取器调用。 你知道我怎样才能实现这一目标吗?

谢谢, 拉杜

In my application I want to know the execution time for a stored procedure.
My pattern is to execute reader and get the data reader and read the results. The reader return immediately and I don’t know the stored procedure execution time.
I cannot put the timers after the reader because I want to have an extension method to encapsulate just the execute reader call.
Do you have any idea how I can achieve that?

Thanks,
Radu

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

少跟Wǒ拽 2024-09-26 03:32:36

对于数据读取器来说这是不可能的,因为数据读取器在您开始读取数据之前不会真正获取数据。

That's not possible with a datareader because the datareader won't actually get the data untill you start reading from it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文