═══ 1. DosTmrQueryTime ═══ Queries the performance timer for a time value. Calling Sequence DosTmrQueryTime (pqwTime) Parameters pqwTime (@OTHER) - A pointer, supplied by the calling application, to the following structure: typedef struct _QWORD { ULONG ulLo, ULONG ulHi, } QWORD; typedef QWORD *PQWORD; Returns o No Error o ERROR_INVALID_PARAMETER - The QWORD structure could not be written to. o ERROR_TMR_NO_DEVICE - This indicates that the timer device driver was not installed o ERROR_DEVICE_IN_USE - This indicates that there are multiple processes attempting to use the 8254 hardware device in a conflicting manner. o ERROR_TMR_INVALID_TIME Remarks This API will fill the QWORD structure, supplied by the caller, with the 64-bit timer value such that : pqwTime->ulHi = The most significant 32-bits of the timer value. pqwTime->ulLo = The least significant 32-bits of the timer value. The performance timer is a free running counter; it is initialized to 0 at boot time and thereafter increments. When it reaches its maximum value of (2к64 - 1), it rolls over to 0 and continues incrementing. A process can time an event by subtracting the value of the timer at the start of the event from the value of the timer at the end of the event. Currently, ulTimerFreq = 1.19318 Mhz, for a timer resolution of about .838 microseconds. (See also DosTmrQueryFreq.) ═══ 2. DosTmrQueryFreq ═══ Queries the performance timer for its frequency. Calling Sequence DosTmrQueryFreq (pulTmrFreq) Parameters pulTmrFreq (@DWORD) - A pointer, supplied by the the calling application, to a ULONG which is to be filled with the timer frequency. Returns o No Error o ERROR_INVALID_PARAMETER - The parameter could not be written to. o ERROR_TMR_NO_DEVICE - This indicates that the timer device driver was not installed o ERROR_DEVICE_IN_USE - This indicates that there are multiple processes attempting to use the 8254 hardware device in a conflicting manner. Remarks Currently, the timer frequency = 1.19318 Mhz, for a timer resolution of about .838 microseconds. (See also DosTmrQueryTime.) ═══ 3. Samples ═══ /* * Description: Display high resolution system time. * * */ #define INCL_DOS #define INCL_DOSERRORS #include #include VOID main() { QWORD qwTime; ULONG rc; if ((rc = DosTmrQueryTime(&qwTime)) != NO_ERROR) printf("\nERROR (DosTmrQueryTime): %d\n", rc); else printf("Time = 0x %08lx %08lx\n", qwTime.ulHi, qwTime.ulLo); }