Home |
RTKernel-32 Programming Manual Multitasking, Real-Time, and RTKernel-32 Alternate APIs for RTKernel-32 Module FineTime |
Module FineTimeModule FineTime is a high-level interface to RTKernel-32's high resolution timer device driver. It allows measuring time intervals and converting high resolution times to real time (seconds, milliseconds, and microseconds). High resolution times are stored as 64-bit unsigned integer values. The resolution of time measurements depends on the timer device driver linked. For example, for the PC timer driver, the resolution is 0.838 microseconds. For the Pentium driver, the resolution depends on the clock rate of the CPU, but is typically much higher. A central data type of module FineTime is RTKFineTime (declared in Rtk32.h), which is a 64-bit unsigned integer. Applications should never directly access RTKFineTime variables but use module FineTime instead. By default, RTKFineTime is implemented as a structure containing two 32-bit integers. However, if your compiler supports a 64-bit integer type, that type can be used instead. To use this feature, define preprocessor symbol RTK_INT_64 to be the type to use for RTKFineTime before including Rtk32.h. Example:#define RTK_INT_64 unsigned __int64 #include <Rtk32.h> #include <Finetime.h> ... The effect of RTK_INT_64 in Rtk32.h is: #ifdef RTK_INT_64 typedef RTK_INT_64 RTKFineTime; typedef RTK_INT_64 RTKFTIMEINT; #else typedef struct { DWORD TimeLow; DWORD TimeHigh; } RTKFineTime; typedef DWORD RTKFTIMEINT; #endif Type RTKFTIMEINT is used by many API functions of module FineTime. If RTK_INT_64 is defined, these functions will return 64-bit instead of 32-bit values. The application interface to module FineTime is declared in include file Finetime.h and documented in the RTKernel-32 Reference Manual.
|