title: Is it possible to suspend a coroutine with a timeout?
body: <p>What I want is a function like this:</p>
  
  <pre><code>suspendCoroutineWithTimeout(timeout: Long, unit: TimeUnit, crossinline block: (Continuation&lt;T&gt;) -&gt; Unit)
  </code></pre>
  
  <p>That does basically the same thing as the existing <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines.experimental/suspend-coroutine.html" rel="noreferrer"><code>suspendCoroutine</code></a> function but if the callback or whatever was provided in the block dosen't get called within the specified timeout the corutine continues but with a TimeoutException or something like that.</p>