DotNext by Roman Sakno

<PackageReference Include="DotNext" Version="2.8.0" />

 Timeout

public struct Timeout
Helps to compute timeout for asynchronous operations.
public bool IsExpired { get; }

Indicates that timeout is occurred.

public bool IsInfinite { get; }

Determines whether this timeout is infinite.

public TimeSpan? RemainingTime { get; }

Gets the remaining time.

public TimeSpan Value { get; }

Gets value of this timeout.

public Timeout(TimeSpan timeout)

Constructs a new timeout control object.

public static bool op_False(ref Timeout timeout)

Indicates that timeout is not reached.

public static TimeSpan op_Implicit(ref Timeout timeout)

Extracts original timeout value from this object.

public static bool op_True(ref Timeout timeout)

Indicates that timeout is reached.

public void ThrowIfExpired()

Throws TimeoutException if timeout occurs.

public void ThrowIfExpired(out TimeSpan remaining)

Throws TimeoutException if timeout occurs.