A few comments about reaction timers, if I may.
It is better to use total_tics as a time counter than timer(). The actual accuracy is the same with both, a frame cycle, due to the need to use a wait(1) command. However, timer() will return a negative value if the time to react is very long. Setting fps_max = 200 will deliver a resolution of 5 msec. This is too long for a "GO/NOGO" reaction time but excellent for a "CHOICE" reaction time.
Reaction time has both cognitive and motor components: one is the time to process the stimuli and make a decision and the other is the correct motor response which may involve a search for the correct key to press. Task design can emphasize either cognition or motor. "reactiontime.c" stresses both cognitive and motor functions.
Thank you.