Task.WaitAny Method (Task, TimeSpan)
Waits for any of the provided Task objects to complete execution within a specified time interval.
Assembly: mscorlib (in mscorlib.dll)
Return ValueType: System.Int32
The index of the completed task in the tasks array argument, or -1 if the timeout occurred.
The Task has been disposed.
The tasks argument is null.
timeout is a negative number other than -1 milliseconds, which represents an infinite time-out.
timeout is greater than MaxValue.
The tasks argument contains a null element.
Available since 4.5
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Available since 5.0
Windows Phone Silverlight
Available since 8.0
Available since 8.1