Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #pragma ident "@(#) libfi/element/irtc.c 92.1 06/16/99 15:47:23"
00038
00039 #include <fortran.h>
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #ifdef _UNICOS
00050
00051 extern long __hertz;
00052 _f_int8
00053 IRTC_RATE(void)
00054 {
00055 return (_f_int8) __hertz;
00056 }
00057
00058 #pragma _CRI duplicate _IRTC_ as IRTC
00059 #pragma _CRI duplicate _IRTC_ as $IRTC
00060 #pragma _CRI duplicate _IRTC_ as _IRTC
00061
00062 _f_int8
00063 _IRTC_(long *result)
00064 {
00065 long rt = (long)_rtc();
00066
00067 if (_numargs() == 1)
00068 *result = rt;
00069 return(rt);
00070 }
00071
00072 #elif defined(__mips)
00073
00074 extern double _nowrap_cycles_per_sec;
00075 extern long long _sysclock_nowrap(void);
00076
00077
00078 _f_int8
00079 irtc_rate_(void)
00080 {
00081 if (_nowrap_cycles_per_sec == 0)
00082 _init_hw_clock();
00083 return (_f_int8) _nowrap_cycles_per_sec;
00084 }
00085
00086 _f_int8
00087 _IRTC_(void)
00088 {
00089 return (_f_int8) _sysclock_nowrap();
00090 }
00091
00092 void
00093 irtc_(_f_int8 *result)
00094 {
00095 *result = _sysclock_nowrap();
00096 }
00097
00098 #else
00099
00100 #include <unistd.h>
00101 #include <sys/time.h>
00102 #include <sys/times.h>
00103
00104 _f_int
00105 _IRTC_(void)
00106 {
00107 clock_t ret;
00108 struct tms buf;
00109 ret = times(&buf);
00110 return( (_f_int) ret);
00111 }
00112
00113 void
00114 irtc_(long *result)
00115 {
00116 *result = _IRTC_();
00117 }
00118
00119 #endif