home *** CD-ROM | disk | FTP | other *** search
- --
- -- this function returns the user time on a Unix system
- -- by interfacing to the c library to access the times
- -- routine
- -- (This version tested on Gould 9780)
- --
- function CPU_TIME_CLOCK return DURATION is
- type BUF is array(1..4) of INTEGER;
- CPU_TIME_AS_DURATION : DURATION;
- TIME_BUF : BUF;
- procedure TIMES (TIME_BUF: out BUF);
- pragma INTERFACE (C,TIMES);
- begin
- --
- -- times returns the user time and system time in units of
- -- 1/60 seconds
- --
- TIMES(TIME_BUF);
- CPU_TIME_AS_DURATION := DURATION(DURATION(TIME_BUF(1))/60.0);
- -- CPU_TIME_AS_DURATION := DURATION(DURATION(TIME_BUF(1) + TIME_BUF(2))/60.0);
- return CPU_TIME_AS_DURATION;
- end CPU_TIME_CLOCK;
-