TestingUtils.WithTimeout(Task, TimeSpan, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Try to complete the task in a given time
public static System.Threading.Tasks.Task WithTimeout (this System.Threading.Tasks.Task taskToComplete, TimeSpan timeout, string message);
static member WithTimeout : System.Threading.Tasks.Task * TimeSpan * string -> System.Threading.Tasks.Task
<Extension()>
Public Function WithTimeout (taskToComplete As Task, timeout As TimeSpan, message As String) As Task
Parameters
- taskToComplete
- Task
The task to run
- timeout
- TimeSpan
The timeout value
- message
- String
The message to put in the TimeoutException if the task didn't complete in the given time
Returns
Exceptions
If the task didn't complete in the given time