Created
September 11, 2015 23:23
-
-
Save drammock/cafd0d9de9b129c49659 to your computer and use it in GitHub Desktop.
testing effect of number of vertices on expyfun circle draw times
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the fourth time running it. It gets worse the more you run it.