/[gnats]/gnats/libiberty/clock.c
ViewVC logotype

Diff of /gnats/libiberty/clock.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by jsm, Tue Oct 26 07:10:16 1999 UTC revision 1.3 by pdm, Mon Dec 10 23:03:27 2001 UTC
# Line 36  the executable file might be covered by Line 36  the executable file might be covered by
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. */
# Line 56  clock () Line 68  clock ()
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

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26