Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
SysTime


NAME

SysTime - access to the system clock

SYNOPSIS

TYPE Time = SysTypes.Time;
TYPE TimesRec =
   RECORD
      utime: Time;          (* CPU time while in user mode *)
      stime: Time;          (* CPU time while in system mode *)
      cutime: Time;         (* user time of all children *)
      cstime: Time;         (* system time of all children *)
   END;
TYPE TimeVal =
   RECORD
      sec: Time;            (* seconds and ... *)
      usec: Time;           (* ... micro seconds *)
   END;
TYPE TimeZone =
   RECORD
      minuteswest: INTEGER; (* of Greenwich *)
      dsttime: INTEGER;     (* type of dst correction to apply *)
   END;


PROCEDURE GetTime() : Time; PROCEDURE GetTimeOfDay(VAR time: TimeVal; VAR timezone: TimeZone); PROCEDURE GetUnitsPerSecond() : INTEGER; PROCEDURE GetProcessTimes(VAR times: TimesRec); PROCEDURE RealTime(reset: BOOLEAN) : Time; PROCEDURE CPUTime(reset: BOOLEAN) : Time; PROCEDURE Alarm(seconds: Time); PROCEDURE AlarmTime() : Time; PROCEDURE Sleep(seconds: Time);

DESCRIPTION

GetTime returns the current GMT time in seconds since Jan, 1, 1970. GetTimeOfDay returns the current time and timezone.

GetUnitsPerSecond returns the number of units per second. Some of the following procedures work with time measurements in units instead of seconds.

GetProcessTimes returns time-accounting information for the current process and for the terminated child processes of the current process. All times are measured in units.

RealTime returns the real time in units elapsed since the start of the process or since the last call with reset TRUE. CPUTime works like RealTime but returns the CPU time.

Alarm causes Sig.ALRM to be raised after the given number of real time seconds. Only one alarm clock is supported by the system. Thus multiple calls of Alarm reset the alarm clock. An argument of 0 causes the alarm clock to be cancelled. AlarmTime returns the number of seconds remaining to the entry of the event. Sleep suspends the process for the given number of real time seconds. Sleep uses Alarm but preserves the setting of the alarm clock. To assure compatibility to other parts of the library, time conditions (see TimeConditions) should be used instead of Sleep.

DIAGNOSTICS

None of these system calls is expected to fail.

SEE ALSO

time(1)
shell command interface to times(2)
alarm(2)
Alarm, AlarmTime, and Sleep
pause(2)
used for suspension by Sleep
time(2)
GetTime
times(2)
GetProcessTimes, RealTime and CPUTime

Edited by: borchert, last change: 2008/10/21, revision: 1.1.2.5, converted to HTML: 2008/10/21

Oberon || Library || Module Index || Search Engine || Definition || Module