Q: Is the time stamp for an morphic event set by OS?

Mark van Gulik ghoul6 at home.net
Wed May 2 08:24:45 UTC 2001


on 5/2/01 1:56 AM, Raymond Tiefenthal at r.tiefenthal at gmx.de wrote:

> Hi.
> 
> problem: I have a working program, sort of a chronometric program, where you
> have to respond to a random stimulus as quickly as possible. Now I'm worried
> the reaction time results may not be accurate enough. Typically, respond
> times are 200ms +/- 30 using mouse buttons. The respond time is meassured
> like this:
[...]
> question: The issue isn't when the click event gets through to the morph
> clicked on, but when the timeStamp is set. My notion is, the OS sets the
> time stamp for the event, then it gets polled sometime from
> EventSensor>>primGetNextEvent:. If thats the way it works, the timeStamp
> would be accurate enough, I guess. The resolution for my app ought to be
> less than 2ms.
[...]
It's not going to happen.  Unless you collect a *HUGE* number of samples,
the resolution is going to be much worse.  There are two probable scenarios:

(1) You're displaying the stimulus on a CRT.

Your monitor refresh rate is probably around 75Hz, or ~13ms.  You might be
able to synchronize to a video-blanking interrupt, but that's pretty darned
tricky.  Besides, doesn't Squeak's scavenger take on the order of 10ms?
It's probably less than that these days, depending on hardware.

(2) You're displaying the stimulus on an LCD or other flat display.

Same problem.  If I understand the technology correctly, LCD displays (and
their ilk) still use scanning to render video RAM into light.  The physical
pixels don't have any long-term "memory", and must be refreshed
periodically.  I don't know what the typical refresh rates and pixel-orders
are, but I'd guess they're around the same as that of a CRT.  I make that
guess based on the fact that they have to scan video RAM just like for a CRT
(which might make your 500Hz+ required refresh rate unrealistic), and maybe
even map a digital value through a D/A converter's resistor ladder, which
has (unwanted) capacitance, and therefore a limited switching time.

Sorry to rain on your parade.

Now if you want to use, say, an oscilloscope or a scanned laser to present
the stimulus...


P.S., First year physics experiment that I'll *always* remember:  One person
holds a meter stick, the other person holds fingers an inch apart at the
zero marker.  The first person drops the stick at a random time (best not to
make eye contact, etc).  The second person pinches fingers to catch the
meter stick.  g=9.806cm/s^2.  The rest is math.  Note that this measures
reaction time without a clock.





More information about the Squeak-dev mailing list