|
Last change
on this file since 3224 was 1392, checked in by bird, 22 years ago |
|
This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.
|
-
Property cvs2svn:cvs-rev
set to
1.1.1.2
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
685 bytes
|
| Line | |
|---|
| 1 | #include "time.h"
|
|---|
| 2 |
|
|---|
| 3 | #ifdef MSDOS
|
|---|
| 4 | #undef USE_CLOCK
|
|---|
| 5 | #define USE_CLOCK
|
|---|
| 6 | #endif
|
|---|
| 7 |
|
|---|
| 8 | #ifndef USE_CLOCK
|
|---|
| 9 | #define _INCLUDE_POSIX_SOURCE /* for HP-UX */
|
|---|
| 10 | #define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
|
|---|
| 11 | #include "sys/types.h"
|
|---|
| 12 | #include "sys/times.h"
|
|---|
| 13 | #endif
|
|---|
| 14 |
|
|---|
| 15 | #undef Hz
|
|---|
| 16 | #ifdef CLK_TCK
|
|---|
| 17 | #define Hz CLK_TCK
|
|---|
| 18 | #else
|
|---|
| 19 | #ifdef HZ
|
|---|
| 20 | #define Hz HZ
|
|---|
| 21 | #else
|
|---|
| 22 | #define Hz 60
|
|---|
| 23 | #endif
|
|---|
| 24 | #endif
|
|---|
| 25 |
|
|---|
| 26 | double
|
|---|
| 27 | etime_ (float *tarray)
|
|---|
| 28 | {
|
|---|
| 29 | #ifdef USE_CLOCK
|
|---|
| 30 | #ifndef CLOCKS_PER_SECOND
|
|---|
| 31 | #define CLOCKS_PER_SECOND Hz
|
|---|
| 32 | #endif
|
|---|
| 33 | double t = clock ();
|
|---|
| 34 | tarray[1] = 0;
|
|---|
| 35 | return tarray[0] = t / CLOCKS_PER_SECOND;
|
|---|
| 36 | #else
|
|---|
| 37 | struct tms t;
|
|---|
| 38 |
|
|---|
| 39 | times (&t);
|
|---|
| 40 | return (tarray[0] = (double) t.tms_utime / Hz)
|
|---|
| 41 | + (tarray[1] = (double) t.tms_stime / Hz);
|
|---|
| 42 | #endif
|
|---|
| 43 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.