36 |
#include <sys/times.h> |
#include <sys/times.h> |
37 |
#endif |
#endif |
38 |
|
|
39 |
#if defined (HAVE_TIMES) && ! defined (HZ) && defined (CLOCKS_PER_SEC) |
#ifdef HAVE_UNISTD_H |
40 |
#define HZ CLOCKS_PER_SEC |
#include <unistd.h> |
41 |
|
#endif |
42 |
|
|
43 |
|
#ifdef _SC_CLK_TCK |
44 |
|
#define GNU_HZ sysconf(_SC_CLK_TCK) |
45 |
|
#else |
46 |
|
#ifdef HZ |
47 |
|
#define GNU_HZ HZ |
48 |
|
#else |
49 |
|
#ifdef CLOCKS_PER_SEC |
50 |
|
#define GNU_HZ CLOCKS_PER_SEC |
51 |
|
#endif |
52 |
|
#endif |
53 |
#endif |
#endif |
54 |
|
|
55 |
/* FIXME: should be able to declare as clock_t. */ |
/* FIXME: should be able to declare as clock_t. */ |
68 |
struct tms tms; |
struct tms tms; |
69 |
|
|
70 |
times (&tms); |
times (&tms); |
71 |
return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ); |
return (tms.tms_utime + tms.tms_stime) * (1000000 / GNU_HZ); |
72 |
#else |
#else |
73 |
#ifdef VMS |
#ifdef VMS |
74 |
struct |
struct |