Exemple #1
0
        private BenchmarkResult BenchmarkQuery(string query, int take = 10, int skip = 0)
        {
            BenchmarkResult result = new BenchmarkResult();

            for (int i = 0; i < 10; i++)
            {
                Stopwatch     timer = Stopwatch.StartNew();
                ISearchResult test  = index.Search(query).Take(take).Skip(skip);
                test.ToList();
                timer.Stop();
                result.Record(timer.ElapsedMilliseconds, test.TotalCount);
            }
            return(result);
        }