System.Threading.CancellationTokenSource.CancelAfter Method

Schedules a cancel operation on this System.Threading.CancellationTokenSource after the specified number of milliseconds.

Syntax

public void CancelAfter (int millisecondsDelay)

Parameters

millisecondsDelay
The time span to wait before canceling this System.Threading.CancellationTokenSource.

Remarks

The countdown for the millisecondsDelay starts during this call. When the millisecondsDelay expires, this System.Threading.CancellationTokenSource is canceled, if it has not been canceled already.

Subsequent calls to CancelAfter will reset the millisecondsDelay for this System.Threading.CancellationTokenSource, if it has not been canceled already.

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0