ICancellationToken.WaitFor Method
Waits up to ATimeoutMs milliseconds for cancellation.
Syntax
Unit: Bcl.Cancellation
function ICancellationToken.WaitFor(ATimeoutMs: Cardinal): Boolean; virtual; abstract;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| ATimeoutMs | Cardinal |
Returns
True if cancellation was requested, False if the time ran out - so that while not Token.WaitFor(1000) do reads as the loop it is. Use it instead of Sleep: a request releases the wait at once.