Time delay in Python script (sleep)

Time delay in python script

import time
time.sleep(5)   # Time you want to delay for, in seconds (can be float value as well)
print('This message was delayed approx. 5 seconds')
This message was delayed approx. 5 seconds

Ace your next data science interview

Get better at data science interviews by solving a few questions per week

Learn more

Find a bug? Submit a suggested change on Github, or message me on Twitter.