suspendCoroutineWithTimeout

inline suspend fun <T> suspendCoroutineWithTimeout(timeoutMillis: Long, crossinline block: (CancellableContinuation<T>) -> Unit): T

Runs a given suspending block of code inside a suspendCancellableCoroutine with a specified timeout and throws a TimeoutCancellationException if the timeout was exceeded.