visigoth.Experiment.wait_until

Experiment.wait_until(end=None, timeout=inf, sleep=0, draw=None, check_abort=False, args=(), **kwargs)[source]

Wait limited by callback and timeout, possibly drawing stimuli.

Parameters
endfloat, key name, or callable, optional

Either the time (corresponding to the experiment clock) that waiting should end, the name of a key that would end the waiting, or a function to call on each interval. Waiting ends if the value returned by this function evaluates to True.

timeoutfloat, optional

Maximum amount of time to wait regardless of func outcome.

sleepfloat, optional

Amount of time to wait on each interval. If 0, the window is drawn after each call to func and so the interval is controlled by the window’s framerate.

drawstring or list of strings, optional

Name(s) of stimuli to draw in each interval.

check_abortbool

If True, check for the abort key after each flip.

argstuple

Positional arguments to func.

kwargskey, value pairs

Other keyword arguments are passed through to func.

Returns
func_val or None

If func returns something that evaluates to True before the timeout, it is returned. Otherwise this function returns None.