title: Python coroutines don't run concurrently with time.sleep()?
body: <p>I'm trying to follow the examples at <a href="https://docs.python.org/3/library/asyncio-task.html#coroutines" rel="noreferrer">https://docs.python.org/3/library/asyncio-task.html#coroutines</a>; here is the code snippet which runs two <code>say_after</code> coroutines concurrently:</p>
  
  <pre><code>import asyncio
  import time
  
  
  async def say_after(delay, what):
      await asyncio.sleep(delay)
      # time.sleep(delay)
      print(what)
  
  
  async def main():
      task1 = asyncio.create_task(say_after(1, 'hello'))
      task2 = asyncio.create_task(say_after(2, 'world'))
  
  
      print(f"Started at {time.strftime('%X')}")
  
      await task1
      await task2
  
      print(f"Finished at {time.strftime('%X')}")
  
  
  if __name__ == "__main__":
      asyncio.run(main())
  </code></pre>
  
  <p>If I run this, I get that the start and end are two seconds apart:</p>
  
  <pre><code>Started at 12:59:35
  hello
  world
  Finished at 12:59:37
  </code></pre>
  
  <p>However, if I replace <code>await asyncio.sleep(delay)</code> with <code>time.sleep(delay)</code> (the commented-out line in the snippet above), I get that they are three seconds apart, and hence essentially running synchronously:</p>
  
  <pre><code>Started at 13:00:53
  hello
  world
  Finished at 13:00:56
  </code></pre>
  
  <p>I don't quite understand this; isn't the point of having concurrent tasks that they run in parallel, even if the tasks themselves contain synchronous code? Why does this example no longer work with <code>time.sleep()</code> instead of <code>asyncio.sleep()</code>?</p>