//
// 摘要:
// Creates a task that completes after a specified number of milliseconds.
//
// 参数:
// millisecondsDelay:
// The number of milliseconds to wait before completing the returned task, or -1
// to wait indefinitely.
//
// 返回结果:
// A task that represents the time delay.
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// The millisecondsDelay argument is less than -1.
public static Task Delay(int millisecondsDelay);
//
// 摘要:
// Creates a cancellable task that completes after a specified number of milliseconds.
//
// 参数:
// millisecondsDelay:
// The number of milliseconds to wait before completing the returned task, or -1
// to wait indefinitely.
//
// cancellationToken:
// A cancellation token to observe while waiting for the task to complete.
//
// 返回结果:
// A task that represents the time delay.
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// The millisecondsDelay argument is less than -1.
//
// T:System.Threading.Tasks.TaskCanceledException:
// The task has been canceled.
//
// T:System.ObjectDisposedException:
// The provided cancellationToken has already been disposed.
public static Task Delay(int millisecondsDelay, CancellationToken cancellationToken);
//
// 摘要:
// Creates a task that completes after a specified time interval.
//
// 参数:
// delay:
// The time span to wait before completing the returned task, or TimeSpan.FromMilliseconds(-1)
// to wait indefinitely.
//
// 返回结果:
// A task that represents the time delay.
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// delay represents a negative time interval other than TimeSpan.FromMilliseconds(-1).
// -or- The delay argument's System.TimeSpan.TotalMilliseconds property is greater
// than System.Int32.MaxValue.
public static Task Delay(TimeSpan delay);
//
// 摘要:
// Creates a cancellable task that completes after a specified time interval.
//
// 参数:
// delay:
// The time span to wait before completing the returned task, or TimeSpan.FromMilliseconds(-1)
// to wait indefinitely.
//
// cancellationToken:
// A cancellation token to observe while waiting for the task to complete.
//
// 返回结果:
// A task that represents the time delay.
//
// 异常:
// T:System.ArgumentOutOfRangeException:
// delay represents a negative time interval other than TimeSpan.FromMilliseconds(-1).
// -or- The delay argument's System.TimeSpan.TotalMilliseconds property is greater
// than System.Int32.MaxValue.
//
// T:System.Threading.Tasks.TaskCanceledException:
// The task has been canceled.
//
// T:System.ObjectDisposedException:
// The provided cancellationToken has already been disposed.
public static Task Delay(TimeSpan delay, CancellationToken cancellationToken);