Guardian Programmer's Guide

Table Of Contents
Managing Time
Guardian Programmer’s Guide 421922-014
18 - 16
Setting and Canceling Timers: Elapsed Time
procedure in the TNS/E environment for time granularity reflected in microseconds
instead of centiseconds.)
Cancel a timer that runs in elapsed time (CANCELTIMEOUT procedure in the TNS
and native environments. Use the TIMER_STOP_ procedure in the TNS/E
environment for time granularity reflected in microseconds instead of
centiseconds.)
Set a timer to time out after a specific length of process time
(SIGNALPROCESSTIMEOUT procedure)
Cancel a timer that runs in process time (CANCELPROCESSTIMEOUT
procedure)
In addition to the procedures indicated above, several other system procedures, such
as AWAITIO and DELAY, take timeout values as parameters. These procedures are
supported internally by the timing mechanism discussed above.
The following group of operations reports total process time. These procedures work
in units of 1 microsecond (.000001 of a second).
Establish how much process time your process has used (MYPROCESSTIME
procedure)
Establish how much process time any process has used (PROCESS_GETINFO_
procedure)
Convert a number of microseconds of process time into a number of hours,
minutes, seconds, milliseconds, and microseconds (CONVERTPROCESSTIME
procedure)
The following paragraphs describe how to perform these operations.
Setting and Canceling Timers: Elapsed Time
You can set a timer to time out after a specified period of elapsed time using the
SIGNALTIMEOUT procedure in the TNS and native environments and the
TIMER_START_ procedure in the TNS/E environment. Using SIGNALTIMEOUT, your
process will receive system message -22 (the Time signal message) when the timer
expires.
You can use the CANCELTIMEOUT or TIMER_STOP_ procedures to cancel a timer
st
arted by the SIGNALTIMEOUT or TIMER_START_ procedures. For example, to
check that an operation is completed within a certain time, you could start the timer
and then start the operation. If the operation finishes within the desired time, you no
longer have a need for the timer; you therefore cancel the timer.
To start the timer, supply the SIGNALTIMEOUT procedure with the time period in 0.01-
second units. Supply the TIMER_START_ procedure with the time period in 0.000001
second units. You can also supply these procedures with values that will allow the
timer to be identified in the message read from $RECEIVE. The SIGNALTIMEOUT or
TIMER_START_ procedures return a value in the tag parameter for passing to the