← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #663952]: program agains relative time

 

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

Bas posted a new comment:
With the minor tweak 
If other people might use it, think there was a type-o

waitUntilStart = time.time()
def waitUntil(nextTime):
     global waitUntilStart
     until = waitUntilStart + nextTime
     while time.time() < until:
         wait(0.1) # the granularity
    # waitUntilStart = time.time()  This needs to be deleted; otherwise it starts from 0 and behaves like regular wait

waitUntilStart = time.time()
waitUntil(2.0); click();
waitUntil(2.8); click();
waitUntil(4.8); click();

Works like a charm! Thanks again.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.