title: How to delay within async function that returns Deferred<T>
body: <p>I have below kotlin coroutine code. <code>doWorkAsync</code> is normal (non suspend) function and it returns <code>Deferred&lt;Int&gt;</code>.</p>
  
  <pre><code>import kotlinx.coroutines.*
  
  fun main() = runBlocking {
      val result = doWorkAsync("Hello ")
  }
  
  fun doWorkAsync(msg: String): Deferred&lt;Int&gt;  = async {
      log("$msg - Working")
      delay(500)
      log("$msg - Work Done")
      return@async 42
  }
  
  fun log(msg: String ) {
      println("$msg in ${ Thread.currentThread().name }")
  }
  </code></pre>
  
  <p>I don't know how to use <code>delay</code> within <code>doWorkAsync</code> function.</p>
  
  <p>I'm using kotlin coroutines version <code>kotlinx-coroutines-core:1.1.1</code>.</p>