Guardian Programmer's Guide

Table Of Contents
Managing Time
Guardian Programmer’s Guide 421922-014
18 - 7
Working With 64-Bit Julian Timestamps
at the last system generation, or the number of microseconds since the last cold load.
You choose the timestamp you want by setting the type parameter as follows:
The current GMT is the default timestamp.
The following example returns the current GMT and the GMT at the last cold load:
LITERAL COLD^LOAD = 1,
SYSGEN^GMT = 2,
SINCE^COLD^LOAD = 3;
FIXED GMT^TIME,
COLD^LOAD^TIME;
INT TYPE;
.
.
GMT^TIME := JULIANTIMESTAMP;
TYPE := COLD^LOAD;
COLD^LOAD^TIME := JULIANTIMESTAMP(TYPE);
Timing an Interval Using Julian Timestamps
To time an interval you should use the Julian timestamp because it is important that
daylight saving time is not adjusted during the interval. However, comparing two GMT
timestamps does not ensure that no clock adjustments have been made. The system
time could have been reset by the SETTIME command or the SYSTEMCLOCK_SET_
or SETSYSTEMCLOCK procedure between the two measurements.
Using the JULIANTIMESTAMP procedure with the type parameter set to 3 returns the
number of microseconds since cold load (instead of a GMT Julian timestamp). This
value is not affected by setting the system time. Comparing this kind of timestamp at
the start of the interval with the same kind of timestamp at the end of the interval
always yields the length of the interval in microseconds. For example:
LITERAL COLD^LOAD = 1,
SYSGEN^GMT = 2,
SINCE^COLD^LOAD = 3;
FIXED TIME1,
TIME2,
INTERVAL;
INT TYPE;
.
.
0 The current GMT
1 GMT at the last system cold load
2 GMT at the last system generation
3 Microseconds since cold load