gcc/libf2c/libF77/etime_.c
Toon Moene a40bb4d345 Update to Netlib version 20001205.
2000-12-09  Toon Moene  <toon@moene.indiv.nluug.nl>

	Update to Netlib version 20001205.
	Thanks go to David M. Gay for these updates.

	* libF77/Version.c: Update version information.
	* libF77/z_log.c: Improve accuracy of real(log(z)) for
	z near (+-1,eps) with |eps| small.
	* libF77/s_cat.c: Adjust call when ftnint and ftnlen are
	of different size.
	* libF77/dtime_.c, libF77/etime_.c: Use floating point divide.

	* libI77/Version.c: Update version information.
	* libI77/rsne.c, libI77/xwsne.c: Adjust code for when ftnint
	and ftnlen differ in size.
	* libI77/lread.c: Fix reading of namelist logical values followed
	by <name>= where <name> starts with T or F.

From-SVN: r38152
2000-12-09 15:34:53 +00:00

48 lines
733 B
C

#include "time.h"
#ifdef MSDOS
#undef USE_CLOCK
#define USE_CLOCK
#endif
#ifndef USE_CLOCK
#define _INCLUDE_POSIX_SOURCE /* for HP-UX */
#define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
#include "sys/types.h"
#include "sys/times.h"
#endif
#undef Hz
#ifdef CLK_TCK
#define Hz CLK_TCK
#else
#ifdef HZ
#define Hz HZ
#else
#define Hz 60
#endif
#endif
double
#ifdef KR_headers
etime_(tarray) float *tarray;
#else
etime_(float *tarray)
#endif
{
#ifdef USE_CLOCK
#ifndef CLOCKS_PER_SECOND
#define CLOCKS_PER_SECOND Hz
#endif
double t = clock();
tarray[1] = 0;
return tarray[0] = t / CLOCKS_PER_SECOND;
#else
struct tms t;
times(&t);
return (tarray[0] = (double)t.tms_utime/Hz)
+ (tarray[1] = (double)t.tms_stime/Hz);
#endif
}