next up previous
Next: 2.17 Low-Level System Interface Up: 2. Environmentally Friendly I/O Previous: 2.15 Field Selection Syntax for Maps

  
2.16 Time

As in CIMS SETL and SETL2, the current date and time are available as the string-valued date, or equivalently date().

Similarly, the integer-valued time in all versions and variants of SETL gives the number of milliseconds of CPU time used so far by the current process and all child processes that have finished and been waited for by any equivalent of wait (see Section 2.17.2 [Processes]).

New in the present version of SETL are the integer-valued *

clock                -- trailing ``()'' optional
which measures the number of milliseconds of ``wall-clock'' time that have elapsed since the calling process started, and *
tod                  -- trailing ``()'' optional
which is the number of milliseconds since the beginning of 1970 (UTC). Also new is *
fdate (msfmt)
which formats its integer argument ms, presumed to represent a number of milliseconds since that moment, as a time and date according to the format given by the string fmt. The format is optional, and defaults to `%a %b %e %H:%M:%S.%s %Z %Y', where the per-cent sign ``escapes'' are as defined for the Unix 98 strftime function as applied to the result of applying its localtime function to ms div 1000, plus the extension that `%s' expands to the low-order 3 digits of fmt in decimal. For example, *
fdate (936433255069) = `Sat Sep  4 04:20:55.069 EDT 1999'
in the US Eastern time zone. The SETL date primitive, which formerly produced the time and date in an implementation-dependent format, is now standardized as meaning fdate (tod, `%c').


next up previous
Next: 2.17 Low-Level System Interface Up: 2. Environmentally Friendly I/O Previous: 2.15 Field Selection Syntax for Maps
David Bacon
1999-12-10