Software Clock APIs
The software clock APIs are:
- Qp0zAdjTime() (Adjust Software Clock) makes small adjustments to the software clock, either slowing it down or speeding it up by the time specified in the delta parameter.
- Qp0zGetTimeofDay() (Get Current Software Clock Time) retrieves the current software clock time and places it in the timeval structure pointed to by tp.
- Qp0zSetTimeofDay() (Set Software Clock) sets the software clock to the time contained in the timeval structure pointed to by tp.
Note: These functions use header (include) files from the library QSYSINC, which is optionally installable. Make sure QSYSINC is installed on your system before using any of the functions. See Header Files for UNIX®-Type Functions for the file and member name of each header file.
The Software Clock is a system facility that determines the current Universal Coordinated Time (UTC) in seconds and microseconds since 1 January 1970, 00:00:00 (epoch-1970). The current time is determined by keeping an internal 'time-delta', which is an offset from the system clock. When Qp0zGetTimeofDay() is called to retrieve the software clock time, the time returned is calculated by taking the current system time, subtracting the QUTCOFFSET system value, then adding the internal time-delta.
The Qp0zSettTmeofDay() API sets or changes the time-delta, without affecting the system clock or the QUTCOFFSET system value. The Qp0zAdjtime() API slowly changes the time-delta, without affecting the system clock either. Adjustments are made at a rate of approximately 1 second of adjustment for every 100 seconds of elapsed time.
System components do not base their timestamps on the software clock, but use the system clock instead. The software clock will be removed in a future release and its use is discouraged.