stimuli.time.sleep🔗

stimuli.time.sleep(duration, *, clock=<class 'stimuli.time._clock.Clock'>)[source]🔗

High precision sleep function.

Parameters:
durationfloat

Duration to sleep in seconds. If the value is less than or equal to 0, the function returns immediately.

clockstimuli.time.BaseClock

Clock object to use for time measurement. By default, the stimuli.time.Clock class is used.

Notes

On Windows, only python version 3.11 and above have good accuracy when sleeping. This accuracy limitation dictates the minimum version of stimuli.

Examples using stimuli.time.sleep🔗

Synchronize sound and trigger

Synchronize sound and trigger