internal void Run()
        {
            try
            {
                task();
            }
            catch (Exception ex)
            {
                ExceptionHelper.ThrowIfFatal(ex);
                ExceptionHelper.OnErrorDropped(ex);
                return;
            }

            long c = count + 1;

            count = c;
            long next = start + c * (long)period.TotalMilliseconds;

            long delay = next - scheduler.NowUtc;

            if (delay > 0L)
            {
                d.Replace(scheduler.Schedule(this.Run, TimeSpan.FromMilliseconds(delay)), c);
            }
            else
            {
                d.Replace(scheduler.Schedule(this.Run), c);
            }
        }
        /// <inheritdoc/>
        public IDisposable Schedule(Action task, TimeSpan initialDelay, TimeSpan period)
        {
            IndexedMultipleDisposable d = new IndexedMultipleDisposable();

            long         start = NowUtc + (long)initialDelay.TotalMilliseconds;
            PeriodicTask t     = new PeriodicTask(task, d, start, period, this);

            d.Replace(Schedule(t.Run, initialDelay), 0);

            return(d);
        }