[visionlist] RTs and Windows

Sergio Navega snavega at intelliwise.com
Thu Jan 10 18:13:17 GMT 2008


Dear Mark and others,

I'm not familiar with the Psych toolbox, but I know a bit
about real time programming under Windows. It is not difficult
to build a C++ application capable of recording sub-millisecond
precision events. The key to do this is to use the following
strategies (sorry if this seems too technical):

a) Build a program that launches a specific thread running
with maximum priority

b) Upon initialization, acquire the real-time clock frequency
of the current machine:

    LARGE_INTEGER   freq;
    QueryPerformanceFrequency(&freq);

c) During an acquisition loop, query the current time frame
between events:

    LARGE_INTEGER   time1, time2;

    QueryPerformanceCounter(&time1);

 // collect one sample
    ..........
    ..........

    QueryPerformanceCounter(&time2);

d) The time between the events (in milliseconds) will be
given by:

    LARGE_INTEGER   timesample;
    timesample.QuadPart = 1000 * (time2.QuadPart - time1.QuadPart) / freq;

Summing up, it is possible to acquire real time events in Windows
with sub-millisecond accuracy.

Sergio Navega.



----- Original Message ----- 
From: "Elliott, Mark" <mark.elliott at nuigalway.ie>
To: <visionlist at visionscience.com>
Sent: Thursday, January 10, 2008 4:43 AM
Subject: [visionlist] RTs and Windows


> Dear netters and listers,
>
> it's an old issue but what is the current state of the art as regards
> recording reaction times under MS Windows? My last attempt, using Psych
> toolbox running under Windows XP, with a special wrapper in the code to
> prioritize the appropriate interrupt, recorded up to 36 ms error relative
> to the timing of a concurrent EEG trigger. What might the error be without
> these precautions, for example in a Dos box running directly from Windows?
>
> Would you record RTs in Windows?
>
> all the best
>
> Mark
>
> Dr. Mark A. Elliott CSci
>
> Senior Lecturer
> Room 201, Cois Abhann
> Dept. Psychology
> National University of Ireland, Galway
> Ireland
>
> Tel.: [Direct line] +353 (0)91 495345; [Internal ext.] 5345
> email: mark.elliott at nuigalway.ie
> http://www.nuigalway.ie/psy/m_elliott_page.htm
>
> _______________________________________________
> visionlist mailing list
> visionlist at visionscience.com
> http://visionscience.com/mailman/listinfo/visionlist
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.19.0/1216 - Release Date: 1/9/aaaa
> 10:16
>
>



More information about the visionlist mailing list