1import time
2
3print("Printed immediately.")
4time.sleep(2.4)
5print("Printed after 2.4 seconds.")
1>>> import time
2>>> time.sleep(3) # Sleep for 3 seconds
3
1import time
2#Waits 1 second
3time.sleep(1)
1import time
2
3print("Print now")
4time.sleep(4.2)
5print("Printing after 4.2 seconds")
1#!/usr/bin/python3
2import time
3
4print ("Start : %s" % time.ctime())
5time.sleep( 5 )
6print ("End : %s" % time.ctime())
7
8# Start : Mon Feb 15 12:08:42 2016
9# End : Mon Feb 15 12:08:47 2016
1import time
2#stops the program for x seconds
3time.sleep(x)