Example #1
0
        public void ForEach_String()
        {
            var enumerator = new HashSet<string>(Enumerable.Range(0, Iterations).Select(x => x.ToString())).GetEnumerator();

            var stopwatch = Stopwatch.StartNew();
            while (enumerator.MoveNext()) { }
            stopwatch.StopAndLog(Iterations);
        }
Example #2
0
        public void ForEach_Int32()
        {
            var enumerator = new HashSet<int>(Enumerable.Range(0, Iterations)).GetEnumerator();

            var stopwatch = Stopwatch.StartNew();
            while (enumerator.MoveNext()) { }
            stopwatch.StopAndLog(Iterations);
        }