How to calculate the time of a LINQ query?

4

I have a table with + - 900mil records. I make some queries using where clauses and I want to see the time difference between them.

How do I display the time in label at the end of the query?

    
asked by anonymous 12.05.2017 / 05:42

1 answer

5

You can use MiniProfiler :

using StackExchange.Profiling;

var profiler = MiniProfiler.Current;
using (profiler.Step("Minha query"))
{
    var alguma coisa = /* Coloque sua consulta LINQ aqui */
}

MiniProfiler works with several templates . Just choose what is part of your application and use.

    
12.05.2017 / 05:49