Guardian Programmer's Guide

Table Of Contents
Managing Time
Guardian Programmer’s Guide 421922-014
18 - 4
Using the Time Management Procedures
Using the Time Management Procedures
The system provides several procedures that you can use to manipulate 128-bit
timestamps, 64-bit timestamps. or 48-bit timestamps. These procedures can convert
timestamps into other representations of date and time and perform further
manipulations of these representations.
A 128-bit timestamp can:
Extract the Julian timestamp from the 128-bit timestamp using the
TS_UNIQUE_CONVERT_TO_JULIAN_ procedure. Use the results returned from
this procedure to compare timestamps generated in different CPUs or on different
systems in the same EXPAND network.
Compare two Unique timestamps generated in the same EXPAND network using
the TS_UNIQUE_COMPARE_ procedure. Comparisons are represented as a
relative ordering of when the two timestamps were generated.
Return a value (in nanoseconds) representing the time since coldload using the
TS_NANOSECS_ procedure. HP recommends using this procedure only when you
need a very fine granularity of time.
A 64-bit timestamp can be converted to
An eight-word array containing a Gregorian representation of the date and time;
that is, the year, month, day of the month, and the time of day down to the number
of microseconds. Time in this representation can be either GMT, LST, or LCT.
A Julian day number.
An integer value representing the day of the week.
A 48-bit timestamp can be converted to a seven-word array containing a Gregorian
representation of the date and time (LCT) in millisecond resolution.
In addition to converting and manipulating timestamps, you can use time management
pr
ocedures to create and interpret 64-bit intervals. These time intervals measure time
in microseconds. Time intervals can simply be a comparison of two 64-bit Julian
timestamps, or they can be a measure of CPU time (CPUTIMES procedure), or
process time (PROCESSTIME procedure or MYPROCESSTIME procedure).
A time interval can also be represented by five words containing the number of hours,
m
inutes, seconds, milliseconds, and microseconds.
Figure 18-1 shows the relationships between the various representations of time, time
intervals, and the system procedures that manipulate them for TNS and TNS/R
systems. Use the TS_UNIQUE_CONVERT_ procedure to manipulate a 128-bit
timestamps.