private void startTimer(IEventLoop eventLoop)
 {
     timer = eventLoop.Schedule(async() =>
     {
         timeout += 5;
         await Action(OriginalPacket);
         startTimer(eventLoop);
     }, TimeSpan.FromSeconds(timeout));
 }
        private void TestScheduleTask(IEventLoop loopA)
        {
            long       startTime = Stopwatch.GetTimestamp();
            AtomicLong endTime   = new AtomicLong();
            var        f         = loopA.Schedule(() =>
            {
                endTime.Value = Stopwatch.GetTimestamp();
            }, TimeSpan.FromMilliseconds(500));

            f.Completion.GetAwaiter().GetResult();

            Assert.True(endTime.Value - startTime >= PreciseTime.ToDelayNanos(TimeSpan.FromMilliseconds(500)));
        }
 public void schedule(IScheduleTask scheduleTask, TimeSpan timeSpan)
 {
     _eventLoop.Schedule(scheduleTask, timeSpan);
 }