Exemplo n.º 1
0
        public void Do(int iterationCount, int iterationTime)
        {
            TimeSpan elapsedTime = TimeSpan.Zero;

            PerformanceHelper.Do(() =>
            {
                int counter = 0;
                while (counter++ < iterationCount)
                {
                    Thread.Sleep(iterationTime);
                }
            }, ts => elapsedTime = ts);

            Assert.True(elapsedTime.TotalMilliseconds >= iterationCount * iterationTime);
        }