Not all CancellationToken
's have a delay at all. It's quite common to use them with a CancellationTokenSource
that calls cancel based on something other than a set amount of time passing.
You'll either need to pass along that information with the Cancellation token to the task, or create your own subclass of CancellationToken
that is only used in conjunction with a delay and that exposes that information publicly.