Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Clock accuracy and OS ticksize in QNX4
Ref. No. QNX.000007743
Category(ies) Utilities
Issue We are having some issues with drift of the software clock in QNX4.  How accurate is the resolution of a PC clock running under QNX4? 

Is there a tool to adjust the number of ticks that make up a period of time?

Solution The QNX4 ticksize utility will allow you to set the resolution of the software clock, used for OS interrupts.  From the command line using the ticksize utility it can be as small as 0.5ms.  From code, using the qnx_ticksize() function, it can be set to a resolution of 838.095345 ns.

The 'rtc' utility is used to adjust the hardware clock. 

If the drift is really bad, create a low priority process that checks with another machine on the network for accurate time and use the 'cron' server to run the process and adjust the time when necessary.

The NTP time synchronization tools, version 1, have been ported to QNX4 and are available in the Contributed software section (/usr/free/qnx4/tcpip/utils/qnx-ntp.tgz)of the QNX Developer's Network.  There is also a port of version 3 there, but an X-server will have to be run to use them.