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...?

link|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
feedback

1 Answer

up vote 0 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.

link|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
feedback

Your Answer

 
or
required, but never shown

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