MODULERTProcessPosix EXPORTSRTProcess ; IMPORT Utime, Uresource; PROCEDURETimevalSecs (READONLY t: Utime.struct_timeval): REAL =
Return the number of seconds represented by t
as a floating-
point number.
BEGIN RETURN FLOAT(t.tv_sec) + (FLOAT(t.tv_usec) / 1.0e6) END TimevalSecs; PROCEDURETimeUsed (): REAL = VAR usage: Uresource.struct_rusage; ret := Uresource.getrusage(Uresource.RUSAGE_SELF, usage); BEGIN <* ASSERT ret = 0 *> RETURN TimevalSecs(usage.ru_utime) + TimevalSecs(usage.ru_stime); END TimeUsed; BEGIN END RTProcessPosix.