Python time module has a method called sleep() that can be used to time delay in Python. The Python sleep() method is equivalent to the Linux sleep command where it takes the argument in seconds as shown below –
1 2 3 |
from time import sleep sleep(5) # Time in seconds |