Function: TIMER Purpose: Returns the cpu time and real time. Category: UTILITY File: timer.c Author: K.G. Begeman Use: CALL TIMER( CT , Input/Output DOUBLE PRECISION RT , Input/Output DOUBLE PRECISION MODE ) Input INTEGER CT Cpu time (in seconds) used since start of programme (MODE=0) or CPU time used since last call to TIMER (MODE<>0). RT Real time (in seconds) since Jan 1 1970 (MODE=0) or real time used since last call to TIMER (MODE<>0). MODE If MODE=0 the current cpu time and real time are returned otherwize the elapsed times are returned. Example: PROGRAM TEST CHARACTER*80 MES DOUBLE PRECISION CT, RT ...... CALL INIT CALL TIMER(CT,RT,0) ...... ...... CALL TIMER(CT,RT,1) WRITE(MES,'(''CPU TIME :'',F10.4,'' SEC'')') CT CALL ANYOUT(3,MES) WRITE(MES,'(''REAL TIME :'',F10.4,'' SEC'')') RT CALL ANYOUT(3,MES) CALL FINIS STOP END Updates: Aug 17, 1991: KGB, Document created. Jul 7, 1999: JPT, Use CLOCKS_PER_SEC instead of CLK_TCK. May 4, 2007: JPT, Include conditional code for Apple Mac.