Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

ex: for stopping the while loop after 5 minute in python

import time

# timeout variable can be omitted, if you use specific value in the while condition
timeout = 300   # [seconds]

timeout_start = time.time()

while time.time() < timeout_start + timeout:
    test = 0
    if test == 5:
        break
    test -= 1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #stopping #loop #minute #python
ADD COMMENT
Topic
Name
9+4 =