|
|
|
|
|
|
|
period short of one hour by about 0.4 seconds. Terms like TIMER_LO are not entirely standard but are generally understood in context in the literature. |
|
|
|
|
|
|
|
|
Each time TIMER_LO overflows, another 16-bit memory word, TIMER_HI, located at 0000:46Eh, is incremented. At a given moment, therefore, TIMER_HI contains a count of the number of hours since the system was booted, and TIMER_LO contains a count of the timer ticks since the last hour was marked. This routine provides the clock information used by the DOS functions 2A, 2B, 2C, and 2D, as well as the DATE and TIME functions. |
|
|
|
|
|
|
|
|
When considering timing on the PC, then, you must consider the attributes of concern. A timing function really has only two attributes accuracy and resolution. The resolution of the PC is its native "granularity," which is the length of a tick interval, or 55 milliseconds. |
|
|
|
|
|
|
|
|
In terms of resolution, then, the PC cannot do better than its native granularity of 55ms. In terms of accuracy, the PC clock is in error by several seconds per day. The typical PC, even one of 486 vintage, is often in error by several minutes per day, owing to the nature of the software run on it. |
|
|
|
|
|
|
|
|
According to the nature of the application, the inaccuracy in the PC timing system can be a major problem or a minor nuisance. The greatest difficulties are encountered in situations such as real-time control of experiments or around-the-clock monitoring. Where interrupts are disabled, as they often must be in data acquisition, additional problems can be encountered, because the PC timing process is itself interrupt driven. |
|
|
|
|
|
|
|
|
In addition, the nature of the reset can create problems for continuous sampling applications, because real midnight and computer midnight occur at different times. Nor is this the end of the problem, since the error is cumulative. |
|
|
|
|
|
|
|
|
The resolution problem with the PC is, in effect, a genetic defect and cannot be solved within the PC itself. Applications that need greater resolution must have recourse to external hardware with a higher frequency time base. I do not further discuss this problem here, since data acquisition still depends upon the details of hardware and application specifics. The concept of virtual instrumentation is making rapid progress in this area, however. |
|
|
|
|
|
|
|
|
Likewise, the answer to the accuracy problem lies in supplying an external source of timing information that is more accurate than the PC itself. |
|
|
|
|
|
|
|
|
This problem touches all computers to the degree that they attempt to maintain internal time without recourse to periodic "reality checks." |
|
|
|
|
|
|
|
|
The National Institute of Science and Technology (NIST) is the primary source for timing information of the kind required. It is the U.S. federal agency charged with keeping time for the civilian sector; the U.S. Naval Observatory performs this task for the military. |
|
|
|
|
|