time.sleep

A function in the time module that pauses the program for a given number of seconds, which may be a fraction.

In more detail

time.sleep(0.05) pauses for a twentieth of a second, and the calling thread does nothing else during the pause. Sleeping in a test to wait for something makes it slower but not reliable, because the thing may still not be ready. Wait for an explicit readiness condition instead.

Related terms

Taught in

References