Home |
RTKernel-32 Programming Manual Function FTSetResolution |
Function FTSetResolutionThis function defines conversion constants required to convert fine times to seconds and vice versa: void FTSetResolution(DWORD UnitsPerSecond, int DivisorMultiplier); For positive values of DivisorMultiplier, times will be converted using formula: FineTime = Seconds * UnitsPerSecond / DivisorMultiplier; For negative values of DivisorMultiplier: FineTime = Seconds * UnitsPerSecond * -DivisorMultiplier; In most cases, the high resolution timer driver will make a call to this function to supply the appropriate default conversion values. However, some drivers do not know the clock rate of the hardware they rely on. In these cases, the application must call FTSetResolution after RTKernelInit to be able to convert fine times to seconds. The PC Timer driver calls FTSetResolution(14318180 / 4, 12 / 4) at program startup. The Pentium driver queries the SM BIOS for the CPU's clock. If this fails, it calls FTSetResolution(120000000, 1), assuming a CPU speed of 120MHz. You can use FTCalibrate to calculate appropriate conversion constants based on the clock driver.
|