示例#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, 1000, 50);
     this.mainWheel = TimerWheel.CreateTimerWheel(TimerWheelBenchmark.resolution, 20);
 }