PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

Time Base

Timer hardware within the system is clocked at a rate that is model dependent. This rate is called the time base. The timing services isolate software from the time base by representing all times in AbsoluteTime values, the units required by the timing services. You may use conversion routines to convert from Nanoseconds or Duration values into AbsoluteTime system units. This conversion can introduce errors, but errors are typically limited to one unit of the time base.

Representing the time base is difficult; the value is typically an irrational number. Mac OS solves this problem by returning a representation of the time base in fractional form--two 32-bit integer values, a numerator and denominator. If you multiply an AbsoluteTime value by the value of numerator and divide the result by the value of denominator, the result is nanoseconds.

When performing sensitive timing operations, it can be important to know the underlying time base. For example, if the time base is 10 milliseconds, there is little value in setting timers for 1 millisecond. You can determine the hardware time base by using GetTimeBaseInfo.

GetTimeBaseInfo


© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)