Timing Accuracy Under Microsoft Windows Revealed Through External Chronometry

Timing Accuracy Under Microsoft Windows Revealed Through External Chronometry

Behavior Research Methods, Instruments, & Computers 2003, 35 (1), 96-108 Timing accuracy under Microsoft Windows revealed through external chronometry CHRISTOPHER D. CHAMBERS University of Melbourne, Melbourne, Victoria, Australia and MEL BROWN Monash University, Melbourne, Victoria, Australia Recent studies by Myors (1998,1999) have concluded that the Microsoft Windows operating system is unable to support sufficient timing precision and resolution for use in psychological research. In the present study, we reexamined the timing accuracy of Windows 95/98, using (1) external chronometry, (2) methods to maximize the system priority of timing software, and (3) timing functions with a theo- reticalresolution of 1 msec or better. The suitability of various peripheral response devices and the rel- ative timing accuracy of computers with microprocessors with different speeds were also explored. The results indicate that if software is properly controlled, submillisecond timing resolution is achiev- able under Windows with both old and new computers alike. Of the computer input devices tested, the standard parallel port was revealedas the most precise, and the serial mouse also exhibited sufficient timing precision for use in single-intervalreaction time experiments. The accuracy of computer-based timing is a central (1999) have proposed a method for achieving 0.1-msec methodological issue in experimental psychology.Under timing precision under Windows 3.1 with the addition of the MS-DOS operatingsystem, several studieshave shown extra hardware. In addition, a number of software pack- that millisecondprecision timing is achievable by access- ages are available either commercially (e.g., E-Prime) or ing a low-level system timer through various high-level at no expense (e.g., DMDX) that claim to provide milli- programming languages, such as QuickBasic (Graves & second precision timing under Windows 95/98 but either Bradley, 1987, 1988), Borland C (Dlhopolsky,1988; Emer- remain untested.1 son, 1988; Warner & Martin, 1999), and Turbo Pascal The studies by Myors (1998, 1999) have provided the (Bovens & Brysbaert, 1990; Creeger, Miller, & Paredes, first evidence that the Windows environment, without 1990; Hamm, 2001; Heathcote, 1988). The timing reso- added hardware, may be unable to support sufficient tim- lution of various input devices, including keyboard, ing accuracy for psychological research. Myors (1999) mouse, and game port is also well established under took an internal time stamp before and after an event that MS-DOS (Beringer, 1992; Crosbie, 1990; Segalowitz & was expected to take 500 msec. In one condition, the Graves, 1990). Newer operating systems, such as Mi- event was a keypress triggered every 500 msec; in the crosoft Windows, have now largely superceded the other, the event was 35 screen refreshes at a refresh rate MS-DOS architecture. The Windows interface provides of 70 Hz. Under different versions of the Windows oper- aesthetic and computational advantages, but opinion is ating system, the error variance of the elapsed time in- divided over the obtainable timing precision. Recent ev- creased to as much as 3,036 msec2, as compared with idence has suggested that the multitasking environment submicrosecond variance under MS-DOS. Although of Windows may be unsuitable for psychological exper- these results are striking, Myors’s method and interpre- iments because the operating system controls the system tation contain several potential flaws. First, all timing access necessary for precise timing (Myors, 1998, 1999). measurements were internally generated and were not Alternatively,McKinney,MacCormac, and Welsh-Bohmer compared with an external chronometer. Therefore, it is not possible to determine what proportion of the mea- sured variance under Windows originated from the sys- Parts of this paper were presented at the 28th Annual Australian tem timer and what proportion was due to variability in Experimental Psychology Conference, Melbourne, April 2001. We the actual duration of the specified event. For example, thank Mark Williams, Jeff Hamm, Richard Plant, and Jon Vaughan for added variability in the time required to register a key- helpful comments on an earlier draft of this manuscript. Correspon- press or perform a screen refresh would increase the vari- dence concerning this article should be addressed to C. D. Chambers, Cognitive Neuroscience Laboratory, Department of Psychology, ability of the elapsed time independently of any actual University of Melbourne,Victoria, Australia 3010(e-mail: c.chambers@ variance in the system timer. Second, during the experi- psych.unimelb.edu.au). mental conditions employing Windows, it is unclear Copyright 2003 Psychonomic Society, Inc. 96 WINDOWS TIMING 97 whether background applications were closed down Prior to Experiment 1, a preliminary investigation was under- prior to testing and whether the timing program was af- taken to examine the latency associated with writing to the parallel forded maximum priority in the stream of operations port from software and, hence, the suitability of using the parallel continually undertaken by a multitasking operating sys- port as an external time stamp. The initial test program was written and compiled under Visual Basic 5 (VB5) for reasons outlined tem. Third, the program was written in C under MS-DOS below in the Software section. Under VB5, read and write opera- and executed through an MS-DOS prompt under Win- tions on the parallel port are supported by the dollx8.dll dynamic dows, so the applicability of the interpretation to a pure link library.2 The write subroutine within dollx8.dll is declared as Windows environment may be limited. Declare Sub WriteDOLLx8 Lib “dollx8.dll” (ByVal x8Port As Integer, We sought to clarify the best achievable timing preci- ByVal value As Integer) sion of the Windows operating system over two experi- The x8Port argument of WriteDOLLx8 is an 8-bit number that ments. In Experiment 1, the precision of the system identifies the port address. For these experiments, we used the Con- timer was examined independently of other internal pro- trol port, which occupies Pins 1–7 of the parallel port. A constant cesses. In Experiment 2, the timing accuracy of input de- called ControlIOPort was assigned as the address for the Control vices was investigated, including the standard serial port: mouse, the PS/2 mouse, and the parallel port. Const ControlIOPort As Integer = 890 Clearly, any variance of the delay associated with switching the EXPERIMENT 1 parallel port from software must be low if the Control port voltage Windows Timing Precision is to be regarded as a suitable time stamp. To examine this variance, a series of write statements were executed serially while the ExT It has been argued that accurate timing under Win- recorded the voltage on Pin 1. The code statements were organized so that the voltage was repeatedly switched between a high state dows 95/98 is complicated by software interruptions as (+5 V) and a low state (0 V), as shown below. a consequence of multitasking and an inability to access ‘--- Define loop variable a low-level system timer (McKinney et al., 1999; Myors, Dim i as long 1999). However, the Windows programming environment For i = 1 to 100000 provides potential solutions to these problems. First, the ‘--- Switch Control port high(+5v) WriteDOLLx8 ControlIOPort, 2 priority of a program within the multitasking stream can ‘--- Switch Control portlow (0v) be adjusted to prevent or minimizeinterruptions. Second, WriteDOLLx8 ControlIOPort, 3 a number of timing functions are available that, theoret- Next i ically, enable access to high-resolution timing. One loop of 100,000 trials was conducted. Following recording, In this experiment, we tested two timing functionsthat the number of A/D samples between each voltage maximum and run under the Windows 95/98 operatingsystems: timeGet minimum was counted and multiplied by the ExT sampling inter- Time, which accesses a tick counter with a maximum val (10 msec) to calculate the time between successive write execu- theoretical resolution of 1 msec; and QueryPerformance tions and, hence, the parallel port write delay (see Figure 1). Across the entire sample of trials, the average write delay was 21.6 msec Counter, which accesses a system timer with a maximum m m m m (SD = 0.05 sec) for the 486 and a constant 10 sec (SD =0 sec) theoreticalresolutionof 0.8381 sec. In addition,the pri- for the PIII.3 The low magnitude and, particularly, the low variance ority of the test program was maximized. Both timers of the write delay indicate that switching the parallel port voltage were tested in each of two computers: a low-end 486 DX provides a suitable time stamp for external analysis. and a high-end Pentium III, to examine whether the ac- curacy of timing under Windows is affected by computer Software configuration. Programming language. The test program was written in VB5. This programming language was chosen for several reasons, many of which are cited by McKinney et al. (1999). The language is na- Method tive to the Windows environment and specifically engineered for Windows programming. In addition, the software is user friendly Hardware and enables easy handling of subsidiary packages that are conve- Test computers. The test machines were IBM-compatible PCs: nient for automated data analysis. a 486 DX, with 66-MHz CPU, a 33-MHz Bus speed, running Win- Thread priority code. The program or thread priority was ma- dows 95 with 16 MB SD RAM; and a Pentium III, with 666-MHz nipulated in two phases. First, the base priority of the system re- CPU, 133-MHz Bus speed, running Windows 98 with 256 MB SD sources, or process, in which the thread operates was optimized. RAM. Second, the priority of the thread was maximized relative to any Preliminary verification of external chronometry. The ex- other threads within the same process. 4 ternal timer was a Tucker-Davis Technology System-II signal gen- The procedure for implementing these changes is as follows. Ini- eration and analysis system (ExT).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    13 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us