handler function

Asked by ONG YI CHONG on 2018-12-12

The docs say that the observation is paused until the handler function is returned. Does that mean that the observation time is paused if the handler function is called ? say if you observe for 1 second, and at t = 0.5, the handler function is called, Then once handler code has completed, the observation timer continues at t = 0.5 ? Just checking my understanding here.

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-12-12
Last reply:
2018-12-13
RaiMan (raimund-hocke) said : #1

the observation time is the time elapsed, hence including the time spent in the handler.

ONG YI CHONG (calveeen) said : #2

so if the handler takes 0.2s to run at t = 0.5, then once the handler function exits at t = 0.7, the remaining observation time is 0.3s ? During the time spent in the handler no observations will be made ?

RaiMan (raimund-hocke) said : #4

--- so if the handler takes 0.2s to run at t = 0.5, then once the handler function exits at t = 0.7, the remaining observation time is 0.3s ?
yep, this is the meaning of elapsed time.

ONG YI CHONG (calveeen) said : #5

Hmm then what would happen if at t = 0.9 the onChange method is called and the observation time is 1 second and also suppose that handler code takes 0.2 seconds to run then the handler finished at t = 1.1. Would the handler function then cut off at t = 1.0 ?

RaiMan (raimund-hocke) said : #6

--- Would the handler function then cut off
no, since the elapsed time is checked after return from handler.
So in your example the total elapsed time for the complete observation will be 1.1 seconds.

Can you help with this problem?

Provide an answer of your own, or ask ONG YI CHONG for more information if necessary.

To post a message you must log in.