Skip to content

Instantly share code, notes, and snippets.

@drammock
Created September 11, 2015 23:23
Show Gist options
  • Save drammock/cafd0d9de9b129c49659 to your computer and use it in GitHub Desktop.
Save drammock/cafd0d9de9b129c49659 to your computer and use it in GitHub Desktop.
testing effect of number of vertices on expyfun circle draw times
import expyfun
import numpy as np
import matplotlib.pyplot as plt
plt.ioff()
n_iter = 10000
edges = np.arange(4, 17, dtype=int)
edges = [10, 100, 500]
times = np.zeros(n_iter)
with expyfun.ExperimentController('wait_test', output_dir=None,
participant='', session='') as ec:
ec.wait_secs(0.5)
for n_edges in edges:
st = ec.current_time
for ii in range(n_iter):
obj = expyfun.visual.Circle(ec, radius=0.5, n_edges=n_edges)
start = ec.current_time
obj.draw()
times[ii] = ec.current_time - start
#ec.flip()
dur = ec.current_time - st
print(dur)
plt.plot(1e3 * times, '-', label=str(n_edges))
plt.xlabel('Trial')
plt.ylabel('Timing delay (ms)')
plt.legend(frameon=False, title='num edges per circle')
plt.show()
@drammock
Copy link
Author

adaptation of this gist by @rkmaddox

@drammock
Copy link
Author

gist

@lkishline
Copy link

draw_test
This is the fourth time running it. It gets worse the more you run it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment