I'm writing a psychology experiment for the Macintosh. How can I get millisecond timing from the keyboard (or mouse)?


From: mac programmers' faq
Date: ???

The simple answer is that you can't. Although the new time manager can call routines every couple of microseconds, input goes through the event manager, which only posts events about every 16 milliseconds. Thus, even if you poll the keyboard every 30 microseconds, you will not get better than 16 ms. resolution. If you really need millisecond accuracy, you need to use external hardware.

The good news is that you probably don't need better than 16 ms. resolution anyway. Measuring with 16 ms. accuracy only increases the standard deviation of your RT means by about 4.8 msec. Read: Ulrich, R. and 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, 1-12.

By the way, there is a mailing list dedicated to running psychology experiments on the Mac. It frequently gets tied up in arguments about millisecond timing. The address to write to is macpsych-request@stolaf.edu.

From: Edgar Matias <ematias@dgp.toronto.edu>
Date: Mon, 5 Apr 1993 14:03:33 -0400

I seem to recall there being some source code in the MacPsych archive (ftp to ftp.stolaf.edu ) that allows better than 30-microsecond timing. See answer to question (G-3).

From: abboud@cedrus.cedrus.com (Hisham A. Abboud)
Date: Fri Sep 16 14:48:22 1994

Your email about timing was brought to my attention by a friend. I just wanted to let you know that we are the publishers of SuperLab, an experimental psych software package. Yes, it is possible to get better than 16 ms from the keyboard; in SuperLab, we've gotten it down to about 4 ms by calling the ADB Manager directly. You're right though, to get 1 ms you need external hardware.

Let me know if you'd like more info about SuperLab. Best regards.

comp.human-factors faq WWW page: