Delay Method (TimeSpan)
Collapse the table of content
Expand the table of content

Task.Delay Method (TimeSpan)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Creates a Task that will complete after a time delay.

Namespace:  System.Threading.Tasks
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Shared Function Delay ( _
	delay As TimeSpan _
) As Task

Parameters

delay
Type: System.TimeSpan
The time span to wait before completing the returned Task

Return Value

Type: System.Threading.Tasks.Task
A Task that represents the time delay

ExceptionCondition
ArgumentOutOfRangeException

The delay is less than -1 or greater than Int32.MaxValue.

After the specified time delay, the Task is completed in RanToCompletion state.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft