Z007: Job Time and Date

Author(s): See below Library: KERNLIB
Submitter: Submitted: 15.01.1977
Language: Fortran or C or Assembler Revised: 18.09.1991

Authors: J. Harms, E. Jansen, A. Michalon, J. Zoll, A. Berglund, T. Cass, C. Wood, H. Renshall.
The DATIME package interfaces with the system of any particular machine to obtain the current calendar date and time, as well as the central processor time used by and remaining to the job.

Structure:

SUBROUTINE subprograms
User Entry Names: DATIME, DATIMH, TIMEX, TIMEL, TIMED, TIMEST
External References: Machine dependent
COMMON Block Names: /SLATE/ ISL(40)

Usage:

    CALL DATIME(ID,IT)
returns decimal INTEGER date and time: ID=yymmdd, IH=hhmm. It also stores the components into /SLATE/ as small integers:

tex2html_wrap_inline101

for convenience of further processing by the user.
    CALL DATIMH(ND,NT)
returns Hollerith date and time: ND = 8Hdd/mm/yy and NT = 8Hhh.mm.ss
    CALL TIMEX(T)
returns the execution time used by the job so far; T is the central processor time in seconds, a REAL number with fractional part. In supported interactive systems the time returned is that relative to the first call to TIMEST.
    CALL TIMEL(T)
returns the execution time remaining until time-limit; T in seconds as for TIMEX. In supported interactive systems the time returned is the time left until the time-limit set by the first call to TIMEST. See Note 4 below.
    CALL TIMED(T)
returns the execution time interval since the last call to TIMED; T in seconds as for TIMEX.

    CALL TIMEST(TLIM)
This routine is necessary to initialise the timing operations in the interactive mode of VM-CMS. In other systems (including VM-CMS batch) it is a dummy do-nothing routine.

It must be called once (subsequent calls are ignored) before any calls to TIMEX and TIMEL. Before this routine is called TIMEX will return zero and TIMEL will return 999.0. TLIM is an input floating point value which will be used inside TIMEL as if it were the job time-limit. The first call to TIMEST also establishes the time origin for subsequent calls to TIMEX and TIMEL.

Accuracy:

IBM: The RMS error returned in consecutive calls to TIMED without any intermediate code is of the order of 3 tex2html_wrap_inline107 sec on the the CERN IBM 3090 with a minimum time for one call of 20 tex2html_wrap_inline109 sec. The timing distribution has a long tail, however, and any individual measurement could take as long as four or five times this value. TIMEX is accurate to within a tenth of a second and TIMEL only to the nearest second.

Notes:

  1. The symbols yy,mm,dd,hh,mm,ss used above stand for the two decimal digits of year, month, day, hours, minutes, seconds.
  2. NT and ND in the call to DATIMH are 2-word vectors on machines with a character-capacity of less than 8 characters per word.
  3. The information returned by these routines is obtained by a system request. On some machines this is expensive in real time, so one should avoid too many calls, to TIMEL in particular.
  4. Some machine/operating system configurations do not have a value for timelimit, for example interactive work under VM-CMS (IBM) or VMS (VAX) or no-limit batch job classes under VMS. In these cases a constant time-left of 999.0 seconds is returned, unless the time limit has been set with TIMEST.

Examples:

Suppose the date is Sept 16, 1976, and the time of day 19h 24m 55s.

    CALL DATIME(ID,IT)
returns tex2html_wrap_inline111
    CALL DATIMH(ND,NT)
returns ND = 8H16/09/76 and NT = 8H19.24.55.
tex2html_wrap_inline117

Michel Goossens Wed Jun 5 09:47:01 METDST 1996