System Timer Information [ Getting System Information Programmer's Guide ] MPE/iX 5.0 Documentation
Getting System Information Programmer's Guide
System Timer Information
The system timer keeps track of elapsed system time, in milliseconds,
since the midnight preceding the last system coldload. The following
intrinsics enable you to return the system time and date to your program.
Note that the information is returned, but not formatted; to format it,
you must use the intrinsics described in the next part of this chapter.
TIMER
The TIMER intrinsic returns the current system timer and overflow count
in milliseconds. Call it in the following form:
count:=TIMER;
The actual millisecond count is returned in count. The value returned by
this intrinsic can be used to measure the real time elapsed between two
events, or it can be used in routines that generate random numbers.
NOTE TIMER is reset to zero at 24-day intervals at 12:00 midnight. If
you are using TIMER to compute elapsed time, correct for this
condition as follows:
1. Subtract the current count from the previous count.
2. If the result is negative, add 2,073,600,000 (the number of
milliseconds in 24 days).
CLOCK
The CLOCK intrinsic returns the current clock time according to the
system timer--that is, the millisecond count is "translated" into hours,
minutes, seconds, and tenths of seconds. The current clock time is
returned in time. You call it in the following form:
time:=CLOCK;
CALENDAR
The CALENDAR intrinsic returns the current calendar date according to the
system timer. The information returned includes the day of the year and
the year of the century. The current date is returned in date. Call it
in the form:
date:=CALENDAR;
MPE/iX 5.0 Documentation