示例#1
0
        public static IReadOnlyList <int> GenerateTimeoutList(
            int count,
            int maxTimeoutValue,
            int resolution)
        {
            IReadOnlyList <int> possibleValues = TimerUtilities.GeneratePossibleValuesList(maxTimeoutValue, resolution);
            List <int>          timeouts       = new List <int>(count);

            for (int i = 0; i < count; i++)
            {
                timeouts.Add(possibleValues[TimerUtilities.random.Next(0, possibleValues.Count)]);
            }
            return(timeouts);
        }
 public TimerWheelBenchmark()
 {
     this.timeouts  = TimerUtilities.GenerateTimeoutList(10000, 10000, 1000);
     this.mainWheel = TimerWheel.CreateTimerWheel(TimeSpan.FromMilliseconds(1000), 10);
     this.timerPool = new TimerPool(1);
 }