Measure stored procedure duration
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.
精彩评论