Calculating the time of a LINQ query ?
-
Hi guys. I'm gonna calculate a LINQ query time. How can we do it ? Could you guide me ? Thank you
-
Hi guys. I'm gonna calculate a LINQ query time. How can we do it ? Could you guide me ? Thank you
Just before running the query take the time and store it in datetime variable and then take time after running it. Difference between them is the time it took for query:cool::cool:
Abhishek Sur My Latest Articles Basics on LINQ and Lambda Expressions
Create .NET Templates -
Just before running the query take the time and store it in datetime variable and then take time after running it. Difference between them is the time it took for query:cool::cool:
Abhishek Sur My Latest Articles Basics on LINQ and Lambda Expressions
Create .NET TemplatesThanks :)
-
Thanks :)
But I think LINQ queries are not executed until you somehow access the result like foreaching over it or something like that. So you have to include that into the measurement.
-
But I think LINQ queries are not executed until you somehow access the result like foreaching over it or something like that. So you have to include that into the measurement.
Do know any references about it ? if so, what's your suggest for estimating a LINQ query time ?
-
Do know any references about it ? if so, what's your suggest for estimating a LINQ query time ?
Mohammad Dayyan wrote:
Do know any references about it ?
http://www.hookedonlinq.com/LINQtoSQL5MinuteOverview.ashx[^]
The moment we entered the foreach loop (that’s important, the SQL was only executed the first time we requested data, until then the query was just kept in-memory as an expression, this is called Deferred Execution), the following SQL Statement was formulated by LINQ and executed on the server.
Mohammad Dayyan wrote:
if so, what's your suggest for estimating a LINQ query time ?
Maybe it's enough to get the first element of the result and do nothing with it to execute the query..
-
Hi guys. I'm gonna calculate a LINQ query time. How can we do it ? Could you guide me ? Thank you