← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #252884]: Time based if statements

 

Question #252884 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/252884

    Status: Open => Answered

RaiMan proposed the following answer:
# the principal solution
start = time.time() # set the current time

while some_condition: # start loop
    # some code
    if exists(image) and (time.time() - start) > 30:
        start = time.time() # reset to current time for next lap
        # do domething
    else:
        pass
    # more code
# after loop

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.