Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I intend to write a program that will measure reaction time. I'm not sure yet about the programming language I'll use. The program will be used as part of a psychology experiment. Ideally, I'd like it to run under Windows.

But before I actually go to the effort of writing the program, I'd like to have some confidence that the resulting reaction-time data will be accurate to within a few milliseconds. An acquaintance has told me that it's not really possible under Windows to accurately time events, independent of background processes (antivirus scans, etc.). First of all, is that true? Second, if it's true, how do I get around this problem? Do I use Linux, or...?

share|improve this question
    
I've seen programs like this before. A psychologist I knew bought one off the shelf. But with a few weeks of programming experience, you should be able to write it yourself if you put in the time. –  surfasb Sep 21 '11 at 2:31
    
The program I have in mind will have some special characteristics that are unique to the problem that is being investigated. It's unlikely that an off-the-shelf program will suit my needs. –  Alex Chernavsky Sep 21 '11 at 13:35
add comment

3 Answers

up vote 2 down vote accepted

To guarantee accurate data, you need a realtime OS. Linux by default is no better than Windows, but Linux can be configured with a real-time capable kernel (IIRC).

For details on how to write such a program, I suggest you ask on stackoverflow.com.

Now, in practice, you will get reasonably accurate results under Windows as well. Process scheduling will only affect the results very little. Most antivirus software runs in userspace, which means they are on equal terms with your application. Your best bet is to try and see.

share|improve this answer
    
Thanks for the tips. You wrote, "Your best bet is to try and see". The problem is that I have no independent way of verifying the accuracy of the results, save by comparing them to some theoretical values from the literature. I think what will do is install a real-time version of Linux on a spare machine that I have handy, and then try to write the program in some language that is available in Linux. Perhaps I'll also write the same program in Windows (my preferred environment) and see if the results are comparable. –  Alex Chernavsky Sep 21 '11 at 13:39
    
At some point you just need to make a decision otherwise you will get to a point where you will be asking where in the keystroke registers as a press I would just say use any os and take averages of a few runs –  Hugoagogo Jun 24 '12 at 22:32
add comment

Dedicated data acquisition hardware can make measurements accurate to whatever your budget allows, independent of the operating system and language. I'm most familiar with National Instruments hardware and software, but there are other vendors.

share|improve this answer
add comment

I think its not very problematic I used GFA-basic see: https://dl.dropbox.com/u/25791210/gb32.zip

my (most simple) program runs as follows:

Dim x, y, z As Integer
Dim ttt, tijd As Double

nogeens:
Print AT(5, 5); "wait"
Print "                    (press 'p' when screen goes black)"
Pause 50
Print AT(5, 5) ; "READY ??  "

Pause 40 + Rnd * 20

ttt = Timer
For y = 1 To 550
  Line 0, y, 1000, y
Next
While InKey$ <> "p"
Wend
tijd = Timer - ttt
Cls

If tijd < .1
  Print "FALSE START",
  Print "Press 'p' just AFTER you have seen the screen blackened  !!"
  Print "press 'q'to try once again"
Else
  Print AT(5, 5); tijd
  Print "press 'q'to try once again"
EndIf

While InKey$ <> "q"
Wend
Cls
GoTo nogeens
share|improve this answer
    
If you want to update your answer, use the edit link below the post, don't post another answer. –  Oliver Salzburg Jan 14 at 15:07
    
This does not address OS overhead, and cannot guarantee results accurate to within a few ms. –  ChrisInEdmonton Jan 14 at 15:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.