Filed under processing

electro-mechanical turk

introducing the electro-mechanical turk: We connect a photodiode and a solenoid to an Arduino, place the diode at a screen and the solenoid over a keyboard, and can now measure precisely how long stimuli are presented on the screen by ScriptingRT, DMDX, e-prime, or other programs, and how long it takes the software to register a keyboard button press. everything open source of course.

testing processing 2

this is a graphical equivalent of the processing test. If processing would measure to the millisecond, the dots would be set with almost no blanks in between – ideally you would see a white screen in the end. Instead, what I always see are lines. This shows that the measurement is rounded. In addition, there are “wholes” showing that during these times, the measurement got even worse, with less accuray.

timetest

testing processing 1

a quick timing test of processing. It measures the latency between two draw cycles for different frameRates. The test shows on all computers that we used that millis() seems to measure not continuously, but in steps of 10-15 ms, depending on the computer. In other words: every time measured with millis() will be rounded up or down to the nearest 10 or 15 ms.

Note: download the processing code and run in the processing environment on your computer to see the full output. The output to the screen may be cut of.

on my machine (old ibm thinkpad running win xp), the output looks like this – you clearly see the jumps of 10 ms irrespective of the frameRate

Rate was 60
0 337x
10 641x
11 9x
20 9x
21 1x
30 2x
60 1x
——————————————–
Rate was 100
0 12x
10 955x
11 15x
——————————————–
Rate was 200
0 446x
10 542x
11 8x
20 4x
——————————————–
Rate was 500
0 779x
10 203x
11 2x
20 7x
30 3x
40 4x
50 2x
——————————————–
Rate was 1000
0 848x
10 147x
11 3x
20 2x
——————————————–

Follow

Get every new post delivered to your Inbox.

Join 167 other followers