Skip to content

Instantly share code, notes, and snippets.

Created Dec 30, 2011
What would you like to do?
A simple timing checker for OpenSesame (paste in inline_script)
from openexp.canvas import canvas
c1 = canvas(self.experiment)
c2 = canvas(self.experiment)
c3 = canvas(self.experiment)
soa = 0 # The desired SOA. 0 = fastest possible
N = 10 # Nr of repetitions
w = self.get('width')
h = self.get('height')
# Create a gray canvas for visual purposes
c1.rect(0, 0, w, h, fill=True, color='gray')
for i in range(N):
# Show canvas 1 and 2 and remember the timestamps
t1 =
t2 =
# Print the SOA and the observed duration
# and show it briefly
c3.text('%s / %s ms' % (soa, t2-t1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment