public interface IScheduler
Abstraction of scheduler-like operations, used for testability.
Note that this is different to TaskScheduler, which is really involved with assigning tasks to threads rather than any sort of delay.
Task Delay(TimeSpan delay, CancellationToken cancellationToken)
Returns a task which will complete after the given delay. Whether the returned awaitable is configured to capture the current context or not is implementation-specific. (A test implementation may capture the current context to enable reliable testing.)
Time to delay for. Must not be negative.
The cancellation token that will be checked prior to completing the returned task.
A task which will complete after the given delay.