开发者

Measure stored procedure duration

开发者 https://www.devze.com 2023-01-16 10:16 出处:网络
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 ret开发者_开发技巧urn immediately

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 ret开发者_开发技巧urn 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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消