0

In c# we can do something like task.delay(t), stoping the execution of the current thread without blocking it, and allowing that thread to do other stuff until pass time t. So, my question is: what is the way to do this in python?

ldiaz997
  • 128
  • 8

1 Answers1

1

the async "awaitable" sleep func is asyncio.sleep() (see the example provided there).

(as opposed to time.sleep which is just a regular sleep like C#'s Thread.Sleep...)

Adam.Er8
  • 12,675
  • 3
  • 26
  • 38
  • Delay in C: delay function is used to suspend execution of a program for a particular time. The op wants to **stop** the execution of the program – Barb Oct 31 '19 at 14:44
  • 2
    @Barb in C# Task.Delay is awaitable, hence OPs request for "stopping execution without blocking it". The equivalent of which in python is exactly asyncio.sleep. – Adam.Er8 Oct 31 '19 at 15:04