Example #1
0
        public int Part2(int input, int count)
        {
            var spinLock = new SpinLock(input);

            var sw = Stopwatch.StartNew();

            for (int i = 0; i < count; i++)
            {
                sw.Restart();
                spinLock.MoveNext();
                sw.Stop();
                TestContext.Progress.WriteLine($"{count - i} - {sw.ElapsedMilliseconds}");
            }
            return(spinLock.ValueAfter0);
        }