1import time
2
3print("Printed immediately.")
4time.sleep(2.4)
5print("Printed after 2.4 seconds.")
1import time
2
3start = time.time()
4print("sleeping...")
5time.sleep(0.5)
6print("woke up...")
7elapsed_time = time.time() - start
8
9print("elapsed time:", elapsed_time * 1000, "milliseconds")