TaskHelperTimeoutAsync Method | |
Completes either when task completes or when
timeoutMilliseconds have elapsed, whichever comes first.
Namespace: Lawo.Threading.TasksAssembly: Lawo (in Lawo.dll) Version: 1.4.1707.27006
Syntax public static Task<bool> TimeoutAsync(
this Task task,
int timeoutMilliseconds
)
Parameters
- task
- Type: System.Threading.TasksTask
The task to wait for. - timeoutMilliseconds
- Type: SystemInt32
The maximum number of milliseconds to wait.
Return Value
Type:
TaskBooleantrue if the
task did not complete within
timeoutMilliseconds; otherwise,
false,
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Task. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also