コード例 #1
0
ファイル: Program.cs プロジェクト: markchipman/RangeTree
        static void TreeExample3()
        {
            Console.WriteLine("Example 3");

            var tree  = new RangeTreeAsync <int, RangeItem>(new RangeItemComparer());
            var range = new Range <int>(50, 60);

            var stopwatch = new Stopwatch();

            stopwatch.Start();

            for (int i = 0; i < 100; i++)
            {
                for (int j = 0; j < 100; j++)
                {
                    RandomTreeInsert(tree, 1000);
                }

                var resultCount = tree.Query(range).Count();
                Console.WriteLine("query: {0} results (tree count: {1})", resultCount, tree.Count);
            }

            stopwatch.Stop();
            Console.WriteLine("elapsed time: {0}", stopwatch.Elapsed);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: mbuchetics/RangeTree
        static void TreeExample3()
        {
            Console.WriteLine("Example 3");

            var tree = new RangeTreeAsync<int, RangeItem>(new RangeItemComparer());
            var range = new Range<int>(50, 60);

            var stopwatch = new Stopwatch();
            stopwatch.Start();

            for (int i = 0; i < 100; i++)
            {
                for (int j = 0; j < 100; j++)
                    RandomTreeInsert(tree, 1000);

                var resultCount = tree.Query(range).Count();
                Console.WriteLine("query: {0} results (tree count: {1})", resultCount, tree.Count);
            }

            stopwatch.Stop();
            Console.WriteLine("elapsed time: {0}", stopwatch.Elapsed);
        }