home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!nntp-server.caltech.edu!almach.caltech.edu!shoppa
- From: shoppa@almach.caltech.edu (TIM SHOPPA)
- Newsgroups: comp.lang.fortran
- Subject: Re: getting system time (runtime) in fortran
- Date: 15 Dec 1992 15:32 PST
- Organization: California Institute of Technology
- Lines: 47
- Distribution: world
- Message-ID: <15DEC199215323047@almach.caltech.edu>
- References: <swood.724386338@vela>
- NNTP-Posting-Host: almach.caltech.edu
- News-Software: VAX/VMS VNEWS 1.41
-
- In article <swood.724386338@vela>, swood@vela.acs.oakland.edu (Scott Wood - EVENSONG) writes...
- >I have an assignment that I would like to do in fortran (don't ask me why)
- >but I need to be able to get run time to monitor the efficiency of the program.
- >
- >I am compiling on a VAX system running a VMS OS (don't ask me why).
- >
- >If you can help me out, please send me mail asap.
- >
- >Thanks
- >
- >swood
- >
- Hi,
- Here is a function that does what you want in VMS Fortran. I'm
- posting it as well as sending it to you because it might come in handy
- for others too. I think it is quite self-explanatory.
-
- Tim (shoppa@erin.caltech.edu)
-
- INTEGER*4 FUNCTION ITCPU( )
- C****
- C****
- C**** SYSTEM SERVICES ROUTINE IS USED TO OBTAIN CPU TIME USED
- C**** TIME IS MEASURED IN UNITS OF 10msec TICKS
- C****
- C****
- EXTERNAL JPI$_CPUTIM
- INTEGER*4 SYS$GETGPI
- INTEGER*4 ICPU
- INTEGER*4 ITEMLIST(4)
- INTEGER*2 ITEMLST(8)
- EQUIVALENCE( ITEMLIST(1), ITEMLST(1) )
- C****
- C****
- ITEMLST(1) = 4
- ITEMLST(2) = %LOC(JPI$_CPUTIM)
- ITEMLST(7) = 4
- ITEMLST(8) = 0
- ITEMLIST(2) = %LOC(ICPU)
- ITEMLIST(3) = 0
- C****
- C****
- CALL SYS$GETJPI( , , , ITEMLIST, , , )
- ITCPU = ICPU
- RETURN
- END
-
-