Bewerken

Delen via


TestingUtils.WithTimeout(Task, TimeSpan, String) Method

Definition

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

Applies to