Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (H-K)
Guardian Procedure Calls Reference Manual522629-013
7-53
JULIANTIMESTAMP Procedure
Procedures that work with a 64-bit Julian timestamp are COMPUTETIMESTAMP,
CONVERTTIMESTAMP, INTERPRETTIMESTAMP, JULIANTIMESTAMP, and
SETSYSTEMCLOCK. Where possible, it is recommended that applications use
these procedures rather than the procedures that work with 48-bit timestamps.
A 48-bit timestamp is a quantity equal to the number of 10-millisecond units since
00:00, 31 December 1974. The 48-bit timestamp always represents local civil time
(wall clock time); consequently, this value is affected by standard time/daylight
saving time changes and time zone differences.
Procedures that work with a 48-bit timestamp are: CONTIME, TIME, and
TIMESTAMP.
Process creation time is initialized by calling TIMESTAMP, which returns the local
civil time in centiseconds (0.01 second = 10 milliseconds) since midnight (00:00)
on 31 December 1974, in an array of three words. Only the two low-order words
are saved in the process control block (PCB); this is sufficient to make the
unnamed process ID unique.
The RCLK instruction ($READCLOCK in TAL) is another source of timestamps. It
returns a 64-bit timestamp representing the local civil time in microseconds since
midnight (00:00) on 31 December 1974. Note that this is not a Julian timestamp
and therefore it is not transferable across HP systems. Applications should avoid
using the RCLK instruction except where necessary.
Process timing uses 64-bit elapsed time counters with microsecond resolution;
these are also not Julian timestamps.
There is no way to generalize about internal timing using 64-bit Julian timestamps
or 48-bit timestamps. Each section of the operating system manages time using
the method most appropriate for its application.
All time and calendar units in this discussion are defined in The Astronomical
Almanac published annually by the U.S. Naval Observatory and the Royal
Greenwich Observatory.
The value returned by JULIANTIMESTAMP(3), a count of the number of
microseconds since COLDLOAD of this processor is not affected by SETTIME.
Therefore the calculation:
JULIANTIMESTAMP(0) - JULIANTIMESTAMP(1)
(current time) - (cold load time)
will not always match what is returned by JULIANTIMESTAMP(3).
Example
MY^TIME := JULIANTIMESTAMP; ! returns the current GMT
Note. Because processor clocks are not synchronized to the nearest microsecond, values
obtained from different processors might not agree.