C-DEngine 5.105

TheCommonUtils..::..TaskDelayOneEye Method (Int32, UInt32, Nullable<(Of <(<'CancellationToken>)>)>)

A safe sleep function.

Namespace:  nsCDEngine.BaseClasses
Assembly:  C-DEngine (in C-DEngine.dll)

Syntax


public static Task TaskDelayOneEye(
	int ms,
	uint minPeriod,
	Nullable<CancellationToken> cancelToken
)
Public Shared Function TaskDelayOneEye ( _
	ms As Integer, _
	minPeriod As UInteger, _
	cancelToken As Nullable(Of CancellationToken) _
) As Task
public:
static Task^ TaskDelayOneEye(
	int^ ms, 
	unsigned int^ minPeriod, 
	Nullable<CancellationToken^> cancelToken
)

Parameters

ms
Type: Int32
Time in ms to sleep.
minPeriod
Type: UInt32
Probe for MASTERSWITCH every minPeriod ms. Not used with Async Task. Use the non-async method if you need to use this
cancelToken
Type: Nullable<(Of <(<'CancellationToken>)>)>
A cancel token created by calling SleepOneEyeGetCancelToken().

Remarks


This function sleeps for the specified number of milliseconds. Returns after a certain period of time but cancels (faults with TaskCanceledException) if TheBaseAssets.MASTERSWICH indicates that the app was closed during this period.