The PVT is a simple task where the subject presses a keyboard key as soon as the red square appears. The red square will turn on randomly every few seconds for an input duration (in seconds, normally 600 to 900). The main measurement of this task is not to assess the reaction time, but to see how many times the button is not pressed when the light is on. The purpose of the PVT is to measure sustained attention, and give a numerical measure of sleepiness by counting the number of lapses in attention of the tested subject.
I implimented the PVT using a GUI with a black background. A red square will display in the center of the background periodically during the testing period, and the subject is expected to press any keyboard key once the red square appears. If the subject does not press a key within 30 seconds, the red square is removed and the subject is allocated a 'sleepAtack'. If the subject responds within 500 msec of the red square appearing (but greater than 150 msec), then the subject is allocated a mark in the 'good' category. If the response is too quick, the subject is allocated a mark in the 'tooFast' category. The lapse category is greater than 500 msec. Pressing a key when the red square is not present scores a mark in the excessiveClick category.
To execute a test for a subject for 10 minutes: