import time seconds = 10 end_time = time.time() + seconds while time.time() < end_time: print("This loop will execute for 10 seconds")