Notes on Reaction Time Measurements


Compiled by Natale Stucchi and Claudio de'Sperati 5/3/96
Edited by Andrew B. Watson, 5/10/96

Dear Dr. Watson,
We wish to make public the responses we got in answer to our query on Reaction Times and keyboard use, as also requested by one of them. We thank again everyone for the suggestions.
Natale Stucchi and Claudio de'Sperati (claudio)

Dr. Claudio de'Sperati
DIPSCO, Scientific Institute S.Raffaele
via Olgettina, 58, 20132, Milan, Italy
tel +39 2 26434859, fax +39 2 26434892

Here is the query:
We are starting a reaction time experiment. Since it is a two-choiches task,we sought to use two keyboard keys on the computer (right and left arrows) together with the on-board computer clock.We know that this kind of measure does not provide a very precise estimate of RT, because of the preence of a buffer in the keyboard circuitry which could take about 10-20ms. We have also been told, however, that this should not apply to the first keypress, but only to a second keypress
when two keys are pressed in sequence. Anyone knows wheter this is true? And, in general, what is the accuracy of RT measures using keypresses? Second, apart from the possible poor accuracy in
the RT estimates, is there any other serious problem in using the keyboard keys rather than an external two-swithces device sampled at high frequency? Provided that it is more elegant using an external device, why people do not employ the keyboard keys, which appears to be much simpler? Thank you in advance.

DISCLAIMER: This information is provided as a guide. It is compiled from network contributions and it is not definitive or exhaustive. The compiler and contributors cannot guarantee its accuracy.

Dear Natale and Claudio,

I've been conducting reaction time experiments on a PC platform. The keyboard is problematic for use in reaction times not only because of the keyboard buffering problem, but also because of factors such as the switches and circuitry used in most keyboards construction. In general the use of the gameport in connection with either a standard joystick or purpose built equipment is to be recommended as an alternative. See the following articles for discussion of the suitability of various input devices:
1) Segalowitz, S.J. and Graves, R. (1990) "Suitability of the IBM XT, AT and PS/2 keyboard, mouse, and game port as response devices in reaction time paradigms", Behavior Research Methods, Instruments, and Computers, Vol. 22, pp. 283-289.
2) Beringer, J. (1992) "Timing accuracy of mouse response registration on the IBM microcomputer family", Behavior, Research Methods, Instruments, and Computers, Vol. 24, pp. 486-490.

There are additional problems with conducting reaction time experiments on PC's in that the functions incorporated in most programming languages only allow the recording of reaction times to something a little better than 1/10th of a second. However, the PC hardware timing chip is capable of producing sub-millisecond timing information and several people have come up with algorithms which utilise this fact. The following article details an algorithim which I have used sucessfully from C:
Emerson, P.L. (1988) "TIMEX: A simple IBM AT C language timer with extended resolution", Behavior Research Methods, Instruments, and Computers, Vol. 20, pp. 566-572.
In addition, a series or articles by Graves and Bradley (plus modification by Beringer) detail an algorithm which I have used sucessfully from BASIC (you need all the articles to get details on the most up to date and accurate version of the timer):
1) Graves, R. and Bradley, R. (1987) "Millisecond interval timer and auditory reaction time programs for the IBM PC", Behavior Research Methods, Instruments and Computers, Vol. 19, pp. 30-35.
2) Graves, R. and Bradley, R. (1988) "More on millisecond timing and tachistoscope applications for the IBM PC", Behavior Research Methods, Instruments and Computers, Vol. 20, pp. 408-412.
3) Graves, R. and Bradley, R. (1991) "Millisecond timing on the IBM PC/XT/AT and PS/2: A review of the options and corrections for the Graves and Bradley algorithm", Behavior Reseach Methods, Instruments, and Computers, Vol 23. 377-379.
4) Beringer, J. (1992) "Notes on Graves and Bradley's timer algorithm", Behavior Research Methods, Instruments and Computers, Vol. 24, 453-455.

As a final note before you go to all the trouble of implementing one of these algorithms check the programming language you are using carefully for functions which may do the same thing (I am not up to date on the latest versions of the various languages and new functions may have been introduced). For instance, Turbo C++ v3.0 (a relatively old version) includes a stopwatch class, although its performance in that version is not generally suitable for really accurate timing.

best of luck,

Dr Paul T. Sowden
Department of Psychology
University of Surrey Tel: +44 01483 259175 x2900
GUILDFORD, Surrey Fax: +44 01483 32813
GU2 5XH, U.K. E-mail:

A copy of your query was forwarded to me, and I will try to provide you with a few suggestions. First, many experiments use keyboard reponses for quite fine measurements. I have used a keyboard response in an experiment that detected a 15ms interaction. There is some hardware difference in the way MAC and PC read keyboard, and if you can, you should have an unbuffered get to read the keyboard. There are two papers that can help you to decide whether you think the keyboard is appropriate for you.
1)Wartenburg, F.
Does a clock resolution of 16ms cause problems when measuring movement
times around 100ms?
available from
or by ftp somewhere on that site
2)Ulrich, R., & Giray, M. (1989)
Time resolution of clocks: Effects on reaction time measurement_ Good News for bad clocks. British journal of mathematical and statistical psychology, 42, S. 1-12.
These articles both say that as long as you take a reasonable number of measurements per mean, then your mean should be unbiased, but its standard deviation will reflect the granularity of the timer.

I do not know the answer to your RT question. However, if you get a good answer, I would like to hear about it. We do RT exps and worry also.

jeremy wolfe
Hi Claudio,

We are starting a reaction time experiment. Since it is a two-choiches
task, we sought to use two keyboard keys on the computer (right and left
arrows) together with the on-board computer clock.

Just a small observation - I have absolutely no experience of this and I am certainly no expert in these matters. However, have you considered using the mouse instead as an input device - left button for one choice, right button for another choice. The mouse button input is not buffered, and in fact you will probably find that the input is directly mapped into memory so that you can just check a bit in memory and this will be a direct input from the mouse - i.e. this is as fast as you can get.

| Martin Reddy Dept. of Computer Science |
| University of Edinburgh |
| e-mail : Mayfield Road, EH9 3JZ |
| Tel : (0131) 650 5164 |


I read your message on the CVNet. I have tried to measure the lag on a Macintosh keyboard by using a mechanical device to press a key after the onset a white square on the screen, and using the computer to measure the time from the frame blanking interupt to the time it registers the key press. When I did this I got a range of about 14 msec. Ken Forster has used a similar procedure to measure times on PC keyboards running DOS and got a similar range. He says it appears to be much worse running windows (I don't know why). These are numbers for the first keypress (there was only one per trial).
I hope that helps.


Regarding your inquiry about keyboard vs. external device, I would be afraid of the problems with the keyboard buffer. I am not sure whether that kind of thing could even be bypassed by some low-level code - I guess that also depends on the computer you use. I would avoid all that and use a joystick. In my opinion, pressing a key on the keyboard is not as handy as you think! Joysticks are made for that kind of thing.
Just an opinion from one who has done a lot of "stuff"!

Good luck -
---- Manfred Mackeben, Ph.D. ----
The Smith-Kettlewell Eye Research Institute
San Francisco, California

Keyboard keys are processed by a special CPU which is watching the keys and waiting for a status change. If it finds one then it decodes the key, sends its code to a buffer on the main motherboard via the serial keyboard cable and interrupts the PC's main CPU. The BIOS interrupt 09 service handler then reads the code from the buffer and decodes it with regard to the current status of the shift/CTRL/ALT keys and puts the result into the "keyboard buffer" where it can be detected by operating system functions. This whole process results in a delay of at least 30 ms between mechanical key motion and software based key detection. This is true for EVERY key press not only the first in a sequence!
However, it is rather constant for a given keyboard/motherboard combination. Measurements have been published in Behavior Research Methods, Instruments and Computers, an estimated 2 years ago.
Software for high resolution response timing with keyboard/mouse or external switches (game/printer port) is contained in my (free) library PXL:

Prof. Dr. Hans Irtel

Current Address: Zentrum fuer interdisziplinaere Forschung
Universitaet Bielefeld
Wellenberg 1
D-33615 Bielefeld

I think using a press-keyboard for such an experiment is ill posed. If you are realy interested in reaction times it is much easier to use one or two mouses. The port for the mouse is easy to handle and works more or less on real time, so there you don't have problems with accurate time measurements.
Second I think a keyboard is not very praticle to handle, a mouse is much smaller. Nearly on every computer there are more ports (serial) to connect additional mouses. And to program butten-press events in C or Pascal is very easy.
I hope this information is of any value to you both.

Freundliche Gruesse

Claudio & Natali,
I have looked into this issue.
See: Segalowitz, S.J., & Graves, R. E. (1990). Suitability of the IBM XT, AT, and PS/2 keyboard, mouse, and game port as response devices in reaction time paradigms, Behavior Research Methods, Instruments and Computers, 22, 283-289.
The variable delay applies to all key presses. Whether this is a major problem depends largely on what the other variance is like. If it is a simple RT with RT's of 200 msec and SD of 40ms, then adding in the keyboard variance is significant, if you are trying to detect the difference between two near simultaneous key presses the keyboard is unsuitable, if you are measuring RT's of 1000 msec with a big SD, the keyboard variance is not a problem. Otherwise the issues concern what kind of mechanical device is needed, whether the keyboard meets the experimental requirements.

Roger Graves
Department of Psychology
University of Victoria
P.O. Box 3050
Victoria, B.C. V8W 3P5
Voice: (604) 721-7539 Fax: (604) 721-8929

The "normal" keys are stored in a buffer making measuring of reaction times difficult. I think there is a way to read directly from the keyboad, but I'm not sure. Why not use the "not-normal" keys like SHIFT, CTRL, and ALT? They can be read at memory location 40:17, 40:18, and 40:96. AFAIK they are updated at once (no buffers here).

The bits have the follows meaning:

Bit Set when...
0 right SHIFT key is pressed
1 left SHIFT key is pressed
2 a CTRL key is pressed
3 an ALT key is pressed

Bit Set when...
0 left CTRL key is pressed
1 left ALT key is pressed

Bit Set when...
2 right CTRL key is pressed
3 right ALT key is pressed

I hope it helps.