Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python loop to run for certain amount of seconds

import time

seconds = 10 #The amount of seconds i want the loop to execute 

end_time = time.time() + seconds
while time.time() < end_time:
    print("This loop will execute for 10 seconds")
 
PREVIOUS NEXT
Tagged: #Python #loop #run #amount #seconds
ADD COMMENT
Topic
Name
1+2 =