Advertisement
smathot

Expyriment rendering speed

Sep 28th, 2012
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. import expyriment
  2. import time
  3.  
  4. expyriment.control.defaults.initialize_delay = 0
  5. expyriment.control.defaults.open_gl = False
  6.  
  7. exp = expyriment.design.Experiment()
  8. expyriment.control.initialize(exp)
  9.  
  10. t1 = time.time()
  11.  
  12. # Create stimuli
  13. l = []
  14. for i in range(30):
  15.     l.append(expyriment.stimuli.TextLine(text='test'))
  16.  
  17. t2 = time.time()
  18.  
  19. # Show stimuli
  20. for i in range(29):
  21.     l[i].present(update=False, clear=False)
  22. l[29].present(update=True, clear=False)
  23. t3 = time.time()
  24.  
  25. # Print how long it took to create and present the stimuli. The creation time is
  26. # fine, on my system it's about 2 to 3ms. The presentation time depends on whether
  27. # OpenGL is enabled. If not, it's about 43ms, if it is, it's about 135ms.
  28. print 'CREATION TIME = %.2f' % (1000.*(t2-t1))
  29. print 'PRESENTATION TIME = %.2f' % (1000.*(t3-t2))
  30.  
  31. time.sleep(1)
  32. expyriment.control.end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement