home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4739 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  1.7 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!nntp-server.caltech.edu!almach.caltech.edu!shoppa
  2. From: shoppa@almach.caltech.edu (TIM SHOPPA)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: getting system time (runtime) in fortran
  5. Date: 15 Dec 1992 15:32 PST
  6. Organization: California Institute of Technology
  7. Lines: 47
  8. Distribution: world
  9. Message-ID: <15DEC199215323047@almach.caltech.edu>
  10. References: <swood.724386338@vela>
  11. NNTP-Posting-Host: almach.caltech.edu
  12. News-Software: VAX/VMS VNEWS 1.41    
  13.  
  14. In article <swood.724386338@vela>, swood@vela.acs.oakland.edu (Scott Wood - EVENSONG) writes...
  15. >I have an assignment that I would like to do in fortran (don't ask me why)
  16. >but I need to be able to get run time to monitor the efficiency of the program.
  17. >I am compiling on a VAX system running a VMS OS (don't ask me why).
  18. >If you can help me out, please send me mail asap.
  19. >Thanks
  20. >swood
  21. Hi,
  22.     Here is a function that does what you want in VMS Fortran.  I'm
  23. posting it as well as sending it to you because it might come in handy
  24. for others too.  I think it is quite self-explanatory.
  25.  
  26.                     Tim (shoppa@erin.caltech.edu)
  27.  
  28.       INTEGER*4 FUNCTION ITCPU( )
  29. C****
  30. C****
  31. C**** SYSTEM SERVICES ROUTINE IS USED TO OBTAIN CPU TIME USED
  32. C**** TIME IS MEASURED IN UNITS OF 10msec TICKS
  33. C****
  34. C****
  35.       EXTERNAL JPI$_CPUTIM
  36.       INTEGER*4 SYS$GETGPI
  37.       INTEGER*4 ICPU
  38.       INTEGER*4 ITEMLIST(4)
  39.       INTEGER*2 ITEMLST(8)
  40.       EQUIVALENCE( ITEMLIST(1), ITEMLST(1) )
  41. C****
  42. C****
  43.       ITEMLST(1)  = 4
  44.       ITEMLST(2)  = %LOC(JPI$_CPUTIM)
  45.       ITEMLST(7)  = 4
  46.       ITEMLST(8)  = 0
  47.       ITEMLIST(2) = %LOC(ICPU)
  48.       ITEMLIST(3) = 0
  49. C****
  50. C****
  51.       CALL SYS$GETJPI( , , , ITEMLIST, , , )
  52.       ITCPU = ICPU
  53.       RETURN
  54.       END
  55.  
  56.