Oberon || Library || Module Index || Search Engine || Definition || Module
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);
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.
Oberon || Library || Module Index || Search Engine || Definition || Module