Execute() публичный Метод

public Execute ( System.Action task ) : void
task System.Action
Результат void
 public static void GenerateEventList(TestContext context)
 {
     var throttle = new Throttle(MaxEvents, TimeSpan);
     for (int i = 0; i < TotalEvents; i++)
     {
         var id = i;
         throttle.Execute(() =>
         {
             Events.Add(new Event { Id = id, Time = DateTime.Now });
         });
     }
 }
Пример #2
0
        public static void GenerateEventList(TestContext context)
        {
            var throttle = new Throttle(maxEvents, timeSpan);

            for (int i = 0; i < totalEvents; i++)
            {
                throttle.Execute(() =>
                {
                    events.Add(new Event {
                        id = i, time = DateTime.Now
                    });
                });
            }
        }
Пример #3
0
        public static void GenerateEventList(TestContext context)
        {
            var throttle = new Throttle(MaxEvents, TimeSpan);

            for (int i = 0; i < TotalEvents; i++)
            {
                var id = i;
                throttle.Execute(() =>
                {
                    Events.Add(new Event {
                        Id = id, Time = DateTime.Now
                    });
                });
            }
        }