home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8310 < prev    next >
Encoding:
Text File  |  1992-07-29  |  2.0 KB  |  67 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rphroy!caen!hellgate.utah.edu!fcom.cc.utah.edu!osiris.usi.utah.edu!tim
  2. From: tim@osiris.usi.utah.edu (Tim Burns)
  3. Newsgroups: comp.unix.aix
  4. Subject: Fortran/C timing
  5. Message-ID: <1992Jul29.213246.13866@fcom.cc.utah.edu>
  6. Date: 29 Jul 92 21:32:46 GMT
  7. Sender: news@fcom.cc.utah.edu
  8. Reply-To: tim@osiris.usi.utah.edu (Tim Burns)
  9. Organization: School of Engineering and Applied Sciences, UCLA
  10. Lines: 54
  11. Originator: tim@osiris.usi.utah.edu
  12.  
  13. To: pollack@ucunix.san.uc.edu
  14. Subject: Re: FOrtran utilities
  15. Newsgroups: comp.unix.aix
  16. In-Reply-To: <1992Jul29.192101.27729@ucunix.san.uc.edu>
  17. Organization: School of Engineering and Applied Sciences, UCLA
  18. Cc: 
  19. Bcc: 
  20.  
  21. Hello,
  22.  
  23. Here is a C program that you can call from fortran.  You might want 
  24. to use "MCLOCK*0.01 = seconds" though in your fortran program, because it 
  25. is easier to use.  On the 3090 you would use "CLOCKX = seconds".  
  26.  
  27. As far as date goes, the gettimeofday struct should have the date in 
  28. it somewhere.
  29.  
  30. Hope this helps
  31.  
  32. Tim Burns
  33.  
  34.  
  35. -----------------cut me!-----------------------------------------
  36. #include <sys/time.h>
  37.  
  38. /*  Purpose:  Fortran-callable interface to gettimeofday routine. */
  39.  
  40. int mptime(int *sec, int *usec)
  41. {
  42.    extern int gettimeofday();
  43.  
  44.    struct timeval t;
  45.    struct timezone tz;
  46.  
  47.    int stat;
  48.  
  49.    stat = gettimeofday(&t, &tz);
  50.  
  51.    *sec = t.tv_sec;
  52.    *usec = t.tv_usec;
  53.  
  54.    return(stat);
  55. }
  56. -----------------cut me!-----------------------------------------
  57. -- 
  58.      *__T__*               No matter how deeply I go down into myself
  59.        _i_                 my God is dark, and like a webbing made
  60.       */m\*                of a hundred roots that drink in silence.
  61.                                    --Ranier Maria Rilke 
  62. -- 
  63.      *__T__*               No matter how deeply I go down into myself
  64.        _i_                 my God is dark, and like a webbing made
  65.       */m\*                of a hundred roots that drink in silence.
  66.                                    --Ranier Maria Rilke 
  67.