Method ScheduleRepeating
ScheduleRepeating(Action, TimeSpan, TimeSpan)
Schedules the specified task to be invoked on a specified schedule, after an optional delay.
public ScheduledTask ScheduleRepeating(Action action, TimeSpan schedule, TimeSpan delay = default)
Parameters
actionActionThe task/action to be run.
scheduleTimeSpanThe delay between invocations.
delayTimeSpanAn additional delay for the first time run.
Returns
- ScheduledTask
A disposable object representing the scheduled task. Calling Dispose() will cancel the schedule and any future invocations.
Exceptions
- ArgumentOutOfRangeException
Thrown if the schedule is less than 0.
- ArgumentNullException
Thrown if no action is specified.