summaryrefslogtreecommitdiff
path: root/Build/source/utils/pmx/pmx-2.6.19/libf2c/etime_.c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2013-01-18 07:59:22 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2013-01-18 07:59:22 +0000
commit8118b1b3be31a537d3c5f622f817a75a10c27741 (patch)
tree47d6eff7889e729dd603f80f5cd817c3386723ae /Build/source/utils/pmx/pmx-2.6.19/libf2c/etime_.c
parentbd904730c4c0f4e593cb97725f11eaf36ec72162 (diff)
pmx 2.6.19
git-svn-id: svn://tug.org/texlive/trunk@28859 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/pmx/pmx-2.6.19/libf2c/etime_.c')
-rw-r--r--Build/source/utils/pmx/pmx-2.6.19/libf2c/etime_.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/Build/source/utils/pmx/pmx-2.6.19/libf2c/etime_.c b/Build/source/utils/pmx/pmx-2.6.19/libf2c/etime_.c
new file mode 100644
index 00000000000..2d9a36d8a31
--- /dev/null
+++ b/Build/source/utils/pmx/pmx-2.6.19/libf2c/etime_.c
@@ -0,0 +1,57 @@
+#include "time.h"
+
+#ifdef MSDOS
+#undef USE_CLOCK
+#define USE_CLOCK
+#endif
+
+#ifndef REAL
+#define REAL double
+#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"
+#ifdef __cplusplus
+extern "C" {
+#endif
+#endif
+
+#undef Hz
+#ifdef CLK_TCK
+#define Hz CLK_TCK
+#else
+#ifdef HZ
+#define Hz HZ
+#else
+#define Hz 60
+#endif
+#endif
+
+ REAL
+#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
+ }
+#ifdef __cplusplus
+}
+#endif