Exemple #1
0
        public void Should_quickly_get_the_last_column()
        {
            var splitter = new SeparatorTextSplitter(_stringCursor);
            var firstColumns = splitter
                .Where(x => x.Count > 0)
                .Select(x => new DelimiterTextSplitter(x, '.').Last()).ToList();

            Stopwatch timer = Stopwatch.StartNew();
            splitter = new SeparatorTextSplitter(_stringCursor);
            firstColumns = splitter
                .Where(x => x.Count > 0)
                .Select(x => new DelimiterTextSplitter(x, '.').Last()).ToList();
            timer.Stop();

            Console.WriteLine("Elapsed: {0}ms", timer.ElapsedMilliseconds);

            Console.WriteLine("Rows per second: {0}", firstColumns.Count * 1000L / timer.ElapsedMilliseconds);
        }