← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #167145]: To speed up Sikuli execution, which would be better wait(sec) or exists(image, sec)?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
-- wait(sec)
always waits the specified seconds.
If you want to wait for an image, use:
wait(image, sec)
which will constantly search for the image and return if found. If not found within the given time it ends the script with find failed.

-- exists(image,sec)
does the same as wait(image,sec), but does not throw FindFailed if not found. So it can be used in if/elif/else and while constructs.

*** speed up your script:
- never use wait(sec), always use exists(image,sec). But you need an image to wait for and guess a maximum waiting time.
- restrict the searches to smaller regions, which speeds up the find operation (up to ten times compared to large whole screen)

Find more hints in: faq https://answers.launchpad.net/sikuli/+faq/1607

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