WaitForEventAsync(string, TimeSpan, CancellationToken)
public Task<DiagnosticEvent> WaitForEventAsync(string eventName, TimeSpan timeout, CancellationToken cancellationToken = default(CancellationToken)) Waits for an event with the specified name to be captured. If an event with that name has already been captured, returns immediately.
Parameters
eventNamestring- The name of the event to wait for.
timeoutTimeSpan- The maximum time to wait.
cancellationTokenCancellationToken- A cancellation token.
Returns
The captured event.
Exceptions
System.TimeoutException- Thrown if the event is not captured within the timeout.
