System.Threading.Tasks.Task.WaitAny Method

Waits for any of the provided System.Threading.Tasks.Task objects to complete execution within a specified time interval.

Syntax

public static int WaitAny (Task[] tasks, TimeSpan timeout)

Parameters

tasks
An array of System.Threading.Tasks.Task instances on which to wait.
timeout
A TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.

Returns

The index of the completed task in the tasks array argument, or -1 if the timeout occurred.

Remarks

Documentation for this section has not yet been entered.

Requirements

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