Skip to content

Instantly share code, notes, and snippets.

@rkmaddox
Last active September 11, 2015 22:00
Show Gist options
  • Save rkmaddox/2453d1a38bb246d10ea9 to your computer and use it in GitHub Desktop.
Save rkmaddox/2453d1a38bb246d10ea9 to your computer and use it in GitHub Desktop.
import expyfun
import numpy as np
import matplotlib.pyplot as plt
plt.ion()
n_iter = 1000
times = np.zeros(n_iter)
with expyfun.ExperimentController('wait_test', output_dir=None, participant='',
session='') as ec:
ec.wait_secs(0.5)
for ii in range(n_iter):
obj = expyfun.visual.Circle(ec, radius=(n_iter - float(ii)) / n_iter)
start = ec.current_time
obj.draw()
times[ii] = ec.current_time - start
#ec.flip()
plt.plot(1e3 * times, 'o')
plt.xlabel('Trial')
plt.ylabel('Timing delay (ms)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment